Search notes:

Script: gitac1

#!/usr/bin/perl

# Git: add and commit 1 file

use warnings;
use strict;

die "specify file to add and commit" unless @ARGV;

my $file=shift;

die "$file does not exist" unless (-f $file);

my $git_status = readpipe "git status $file";
die "$file seems to be already added to git" unless $git_status =~ /use "git add <file>\.\.\./;

$git_status = readpipe "git add \"$file\"";
die "$git_status" if $git_status;

$git_status = readpipe "git commit \"$file\" -m \"+ $file\"";
die "$git_status" unless $git_status =~ /^ 1 file changed/m;
Github repository scripts-and-utilities, path: /gitac1

See also

Scripts

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759390905, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/tools/scripts/personal/gitac1(58): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78