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

Re: git-rev-parse(1) questions

From
Junio C Hamano <junkio@cox.net>
Date
Apr 30, 2007, 20:20 UTC
Message-ID
<7vejm1d370.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<alpine.LFD.0.98.0704301138320.3419@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 18 quoted lines
> On Mon, 30 Apr 2007, Jari Aalto wrote:
>> ...
>>     * A colon, optionally followed by a stage number (0 to 3) and a
>>       colon, followed by a path; this names a blob object in the index
>>       at the given path. Missing stage number (and the colon that
>>       follows it) names an stage 0 entry.
>
> You'd never use this unless you're working with a unmerged tree entry, and 
> then you can use it for things like
>
> 	git diff :1:my-path :2:their-path
>
> if you want to look at the differences between the two blobs that are 
> unmerged, and come from different branches (":1:my-path" comes from the 
> branch you were merging things into,and the ":2:their-path" comes from the 
> branch you were merging from).
>
> That can be useful in the extremely rare case...

A small correction. :1:path comes from the common ancestor, :2:mine comes from the branch you are on and merging into, and :3:theirs is what the other branch you were merging from has.

People can see how rarely this is used interactively; even original authors of git can get it wrong ;-).

Previous: Linus TorvaldsNext: Johannes Schindelin
Message 3 of 4 in “git-rev-parse(1) questions”
  1. Jari AaltoApr 30, 2007
  2. Linus TorvaldsApr 30, 2007
  3. Junio C HamanoApr 30, 2007
  4. Johannes SchindelinApr 30, 2007

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.