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

Re: git-diff between /dev/null and blob

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 7, 2006, 12:52 UTC
Message-ID
<eb7d2s$cq2$1@sea.gmane.org>
In-Reply-To
<7vejvt8s24.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Jakub Narebski <jnareb@gmail.com> writes: 
Show 14 quoted lines
>        git diff v0.99:pull.h fetch.h
>
>         echo extra >>Makefile && git diff :0:Makefile HEAD^^:Makefile
> 
>         H=`(cat Makefile; echo extra) | git hash-object -w --stdin`
>       echo "100644 $H 2       foobar" | git update-index --add --index-info
>       git diff :2:foobar :Makefile
> 
>> git-diff doesn't understand :<stage>:<filename> and :<filename> for
>> accessing index version of blob (git-cat-file for example understands
>> it).
> 
> You probably got this impression from a botched experiment or
> something, but this statement is wrong as demonstrated above.
Right, sorry.

And you can write ./<filename> to distinguish it from revision name, so proposed ::<filename> extension is not needed.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C Hamano
Message 5 of 5 in “git-diff between /dev/null and blob”
  1. Jakub NarebskiJul 31, 2006
  2. Junio C HamanoJul 31, 2006
  3. Jakub NarebskiAug 6, 2006
  4. Junio C HamanoAug 6, 2006
  5. Jakub NarebskiAug 7, 2006

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.