git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: something fishy with Git commit and log from file

From
LRLuciano Rocha <luciano@eurotux.com>
Date
Aug 6, 2008, 10:44 UTC
Message-ID
<20080806104432.GG7121@bit.office.eurotux.com>
In-Reply-To
<48997D2E.9030708@obry.net>
On Wed, Aug 06, 2008 at 12:30:06PM +0200, Pascal Obry wrote:
Show 29 quoted lines
> 
>  The following command fails on my repository:
> 
>     $ git commit --file=clog
>     fatal: could not read log file 'clog': No such file or directory
> 
>     $ cat clog
>     toto
> 
>  Using the following command the commit pass without problem:
> 
>     $ cat clog | git commit --file=-
> 
>  With GDB I get:
> 
>  $ gdb --args git ci --file=clog
>  This GDB was configured as "i686-pc-cygwin"...
>  (gdb) break strbuf_read_file
>  Breakpoint 1 at 0x44e64a: file strbuf.c, line 301.
>  (gdb) run
>  Starting program: /usr/local/bin/git.exe ci --file=clog
> 
>  Breakpoint 1, strbuf_read_file (sb=0x22cac0, path=0x22ccfa "clog", hint=0) 
>  at strbuf.c:301
>  301             fd = open(path, O_RDONLY);
>  (gdb) print path
>  $1 = 0x0
> 
>  ???? outch, this is strange, or a gdb artifact?
gdb artifact. The breakpoint info shows the correct value.
Could you at that point run the following?

(gdb) p get_current_dir_name() $1 = ... "..."

If the returned value doesn't match the directory you were in, then there's a bug in git.

If the function doesn't exist, try: (gdb) p getwd(malloc(2048))

Regards, Luciano Rocha

-- 
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
Previous: Pascal ObryNext: Pascal Obry
Message 2 of 15 in “something fishy with Git commit and log from file”
  1. Pascal ObryAug 6, 2008
  2. Luciano RochaAug 6, 2008
  3. Pascal ObryAug 6, 2008
  4. Junio C HamanoAug 6, 2008
  5. Pascal ObryAug 6, 2008
  6. Junio C HamanoAug 6, 2008
  7. Pascal ObryAug 6, 2008
  8. files given on the command line are relative to $cwdJunio C Hamano, Aug 6, 2008
  9. Olivier MarinAug 6, 2008
  10. Junio C HamanoAug 6, 2008
  11. Junio C HamanoAug 6, 2008
  12. Pierre HabouzitAug 6, 2008
  13. Samuel TardieuAug 7, 2008
  14. Luciano RochaAug 7, 2008
  15. Junio C HamanoAug 7, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.