{"thread":{"id":"2647","subject":"strange cg-add problem","startedAt":"2005-11-22T12:30:58Z","lastAt":"2005-11-27T13:08:12Z","messageCount":3,"participants":["Nico -telmich- Schottelius","Junio C Hamano","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12534","messageId":"20051122123058.GB19989@schottelius.org","threadId":"2647","inReplyTo":null,"subject":"strange cg-add problem","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2005-11-22T12:30:58Z","receivedAt":"2005-11-22T12:30:58Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Hello!\n\nI try to backup a MySQLDump and put it into git so we have easy access\nto diffs and can have a real history.\n\nThe problem I have is that it works perfectly, when running manually,\nbut when running in the script git refuses to use the file:\n\n----------------------------------------------------------------------\nsrwali01:/home/server/backup/db# ~/db-dump.sh \n/home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file\ncg-add: warning: not all files could be added\ncg-commit: Nothing to commit\n----------------------------------------------------------------------\n(The script can be found at [0].)\n\nWhen I do that on the command line, this happens:\n\n----------------------------------------------------------------------\nsrwali01:/home/server/backup/db# cg-add /home/server/backup/db//2005-11-22/13:26\nAdding file /home/server/backup/db//2005-11-22/13:26\nIgnoring path /home/server/backup/db//2005-11-22/13:26\nsrwali01:/home/server/backup/db# cg-commit -m \"Backup vom 2005-11-22 um 13:26\"\ncg-commit: Nothing to commit\n----------------------------------------------------------------------\n\nWhen I add it with a relative path it works:\n----------------------------------------------------------------------\nAdding file 2005-11-22/13:26\nsrwali01:/home/server/backup/db# cg-commit -m \"Backup vom 2005-11-22 um 13:26\"\nA 2005-11-22/13:26\nCommitted as 3086174c1c84ce598137062867c07a4b7c619c39.\n----------------------------------------------------------------------\n\nWhen I change it in the script to be relativeo\n[( cd \"$DDIR\"; cg-add \"$SUBDIR/$FILENAME\"; cg-commit -m \"Backup vom $SUBDIR um $FILENAME\") ]\nthan the same happens:\n\n----------------------------------------------------------------------\nsrwali01:~# ./db-dump.sh \n2005-11-22/13:31 does not exist or is not a regular file\ncg-add: warning: not all files could be added\ncg-commit: Nothing to commit\n----------------------------------------------------------------------\n\nAny hint why it behaves differently in script and command line?\n\nBtw, does someone know, why mysqldump does just one insert and a very very long line\nand not many inserts with only one value? The bevahiour of it seems to have changed,\nas mysqldump did that in earlier releases [sorry bit offtopic].\n\nGreetings,\n\nNico\n\n\n[0]: http://linux.schottelius.org/scripts/#db-dump+git.sh\n\n-- \nLatest project: cinit-0.2.1 (http://linux.schottelius.org/cinit/)\nOpen Source nutures open minds and free, creative developers.\n"},{"id":"12544","messageId":"7vbr0cfwqd.fsf@assigned-by-dhcp.cox.net","threadId":"2647","inReplyTo":"20051122123058.GB19989@schottelius.org","subject":"Re: strange cg-add problem","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-22T16:55:38Z","receivedAt":"2005-11-22T16:55:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:\n\n> srwali01:/home/server/backup/db# ~/db-dump.sh \n> /home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file\n> cg-add: warning: not all files could be added\n> cg-commit: Nothing to commit\n\nI do not use cogito, but I suspect it would work if you change\nyour script to avoid double slash between db and 2005-11-22.\n"},{"id":"12795","messageId":"20051127130812.GE22159@pasky.or.cz","threadId":"2647","inReplyTo":"7vbr0cfwqd.fsf@assigned-by-dhcp.cox.net","subject":"Re: strange cg-add problem","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-11-27T13:08:12Z","receivedAt":"2005-11-27T13:08:12Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Nov 22, 2005 at 05:55:38PM CET, I got a letter\nwhere Junio C Hamano <junkio@cox.net> said that...\n> Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:\n> \n> > srwali01:/home/server/backup/db# ~/db-dump.sh \n> > /home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file\n> > cg-add: warning: not all files could be added\n> > cg-commit: Nothing to commit\n> \n> I do not use cogito, but I suspect it would work if you change\n> your script to avoid double slash between db and 2005-11-22.\n\nDid it work? That would have to be GIT's thing, though. Also, GIT does\nnot seem to like absolute paths being passed to git-update-index.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nVI has two modes: the one in which it beeps and the one in which\nit doesn't.\n"}]}