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

Re: [RFC] git-add update with all-0 object

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 2, 2006, 08:55 UTC
Message-ID
<ekrets$v72$1@sea.gmane.org>
In-Reply-To
<7vhcwgcf39.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 7 quoted lines
>         * 'git-diff' [--options] <commit> <commit> -- [<path>...]
> 
>           is to see the changes between two <commit>.
> 
>         Just in case if you are doing something exotic, it
>         should be noted that all of the <commit> in the above
>         descriptoin can be any <tree-ish>.
s/descriptoin/description/
          
It _might_ be worth mentioning that you can compare two arbitrary
files using
   git diff [--options] <blob1 sha> <blob2 sha>

where <blob sha> can be entered as <tree-ish>:<filename>, usually <commit>:<filename> (<filename> is HEAD:<filename>) to compare blob (file) from a named tree/from a given commit, or as :<stage>:<filename> (or just ::<filename> if file is not in merge conflict) to compare blob (file) from an index.

If I understand correctly there is currently no way to compare files from a working tree, not to mention files outside working tree (including /dev/null) with that syntax.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Linus Torvalds
Message 10 of 15 in “[RFC] git-add update with all-0 object”
  1. Daniel BarkalowNov 30, 2006
  2. Johannes SchindelinNov 30, 2006
  3. Nicolas PitreNov 30, 2006
  4. Jakub NarebskiNov 30, 2006
  5. Nicolas PitreNov 30, 2006
  6. Linus TorvaldsNov 30, 2006
  7. Daniel BarkalowDec 1, 2006
  8. Theodore TsoDec 1, 2006
  9. Junio C HamanoDec 1, 2006
  10. Jakub NarebskiDec 2, 2006
  11. Linus TorvaldsDec 1, 2006
  12. Daniel BarkalowDec 1, 2006
  13. Andy ParkinsDec 1, 2006
  14. Jakub NarebskiDec 2, 2006
  15. Jakub NarebskiDec 2, 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.