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

Re: Unexpected cherry-pick behaviour

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2013, 20:15 UTC
Message-ID
<xmqqk3f4o8m8.fsf@gitster.dls.corp.google.com>
In-Reply-To
<B4E4F29CB20847DEB23F21255A040187@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 23 quoted lines
> From: "Philip Oakley" <philipoakley@iee.org>
>> From: "Junio C Hamano" <gitster@pobox.com>, Saturday, December 14,
>> 2013 7:39 PM
>>> "Philip Oakley" <philipoakley@iee.org> writes:
>>>
>>>> Would this be a good use of the
>>>>    * Magic pathspecs like ":(icase)
>>>> that was recently released (v1.8.5  2Dec13)  so that the merge
>>>> stages
>>>> can be named.
>>>
>>> Because the pathspec mechahism is for you to tell an operation that
>>> works on a collection of paths (e.g. "all the paths in the HEAD",
>>> "all the paths at stage #1 in the index") to narrow the set it
>>> operates on down to only those that match, I do not think it is a
>>> good match at all to what you are trying to do.
>>>
>>
>> My point was that the ":1:" syntax already was a "path at stage #1
>> in the index" indicator, and that it would be good to have a
>> memorable name for the :1:2:3: stages as per Antoine's  query.
>
> Could someone point me at where is this syntax decoded?

sha1_name.c (anything that turns name to object name goes there, I think). Look for this comment:

	/*
	 * sha1:path --> object name of path in ent sha1
	 * :path -> object name of absolute path in index
	 * :./path -> object name of path relative to cwd in index
	 * :[0-3]:path -> object name of path in index at stage
	 * :/foo -> recent commit matching foo
	 */

I do not think adding ":ours:path" as a synonym to ":2:path" adds enough value to make it worthwhilte to worry about breaking the expectation of those who thought "ours:path/name" will be something they could track if they wanted to.

Show 13 quoted lines
> My initial hunt around the code base didn't find the relevant location.
>
>>
>> It maybe that my referring to it as a 'magic pathspec' was a
>> mistake, but the difficulty of remembering which number is
>> ours:theirs:base still stands.
>>
>> (for general info; the :<stage>:  format is defined in 'git revision
>> (7)' as the last method for Specifying Revisions)
>>
>> Philip
>> --
> Philip
Previous: Philip OakleyNext: Junio C Hamano
Message 11 of 13 in “Unexpected cherry-pick behaviour”
  1. Paulo MatosDec 10, 2013
  2. Junio C HamanoDec 10, 2013
  3. Paulo MatosDec 11, 2013
  4. Antoine PelisseDec 11, 2013
  5. Paulo MatosDec 11, 2013
  6. Antoine PelisseDec 14, 2013
  7. Philip OakleyDec 14, 2013
  8. Junio C HamanoDec 14, 2013
  9. Philip OakleyDec 15, 2013
  10. Philip OakleyDec 16, 2013
  11. Junio C HamanoDec 16, 2013
  12. Junio C HamanoDec 14, 2013
  13. Antoine PelisseDec 14, 2013

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.