# strange cg-add problem

3 messages from 2005-11-22 to 2005-11-27. Participants: Nico -telmich- Schottelius, Junio C Hamano, Petr Baudis.
Thread: https://gitlist.dev/t/2647

## Nico -telmich- Schottelius, 2005-11-22 12:30

Subject: strange cg-add problem
Message-ID: <20051122123058.GB19989@schottelius.org>
URL: https://gitlist.dev/e/20051122123058.GB19989%40schottelius.org

```
Hello!

I try to backup a MySQLDump and put it into git so we have easy access
to diffs and can have a real history.

The problem I have is that it works perfectly, when running manually,
but when running in the script git refuses to use the file:

----------------------------------------------------------------------
srwali01:/home/server/backup/db# ~/db-dump.sh 
/home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file
cg-add: warning: not all files could be added
cg-commit: Nothing to commit
----------------------------------------------------------------------
(The script can be found at [0].)

When I do that on the command line, this happens:

----------------------------------------------------------------------
srwali01:/home/server/backup/db# cg-add /home/server/backup/db//2005-11-22/13:26
Adding file /home/server/backup/db//2005-11-22/13:26
Ignoring path /home/server/backup/db//2005-11-22/13:26
srwali01:/home/server/backup/db# cg-commit -m "Backup vom 2005-11-22 um 13:26"
cg-commit: Nothing to commit
----------------------------------------------------------------------

When I add it with a relative path it works:
----------------------------------------------------------------------
Adding file 2005-11-22/13:26
srwali01:/home/server/backup/db# cg-commit -m "Backup vom 2005-11-22 um 13:26"
A 2005-11-22/13:26
Committed as 3086174c1c84ce598137062867c07a4b7c619c39.
----------------------------------------------------------------------

When I change it in the script to be relativeo
[( cd "$DDIR"; cg-add "$SUBDIR/$FILENAME"; cg-commit -m "Backup vom $SUBDIR um $FILENAME") ]
than the same happens:

----------------------------------------------------------------------
srwali01:~# ./db-dump.sh 
2005-11-22/13:31 does not exist or is not a regular file
cg-add: warning: not all files could be added
cg-commit: Nothing to commit
----------------------------------------------------------------------

Any hint why it behaves differently in script and command line?

Btw, does someone know, why mysqldump does just one insert and a very very long line
and not many inserts with only one value? The bevahiour of it seems to have changed,
as mysqldump did that in earlier releases [sorry bit offtopic].

Greetings,

Nico


[0]: http://linux.schottelius.org/scripts/#db-dump+git.sh

-- 
Latest project: cinit-0.2.1 (http://linux.schottelius.org/cinit/)
Open Source nutures open minds and free, creative developers.

```

## Junio C Hamano, 2005-11-22 16:55

Subject: Re: strange cg-add problem
Message-ID: <7vbr0cfwqd.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vbr0cfwqd.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20051122123058.GB19989@schottelius.org>

```
Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:

> srwali01:/home/server/backup/db# ~/db-dump.sh 
> /home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file
> cg-add: warning: not all files could be added
> cg-commit: Nothing to commit

I do not use cogito, but I suspect it would work if you change
your script to avoid double slash between db and 2005-11-22.

```

## Petr Baudis, 2005-11-27 13:08

Subject: Re: strange cg-add problem
Message-ID: <20051127130812.GE22159@pasky.or.cz>
URL: https://gitlist.dev/e/20051127130812.GE22159%40pasky.or.cz
In-Reply-To: <7vbr0cfwqd.fsf@assigned-by-dhcp.cox.net>

```
Dear diary, on Tue, Nov 22, 2005 at 05:55:38PM CET, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Nico -telmich- Schottelius <nico-linux-git@schottelius.org> writes:
> 
> > srwali01:/home/server/backup/db# ~/db-dump.sh 
> > /home/server/backup/db//2005-11-22/13:26 does not exist or is not a regular file
> > cg-add: warning: not all files could be added
> > cg-commit: Nothing to commit
> 
> I do not use cogito, but I suspect it would work if you change
> your script to avoid double slash between db and 2005-11-22.

Did it work? That would have to be GIT's thing, though. Also, GIT does
not seem to like absolute paths being passed to git-update-index.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.

```
