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

Re: [PATCH v2] contrib/rerere-train: optionally overwrite existing resolutions

From
Raman Gupta <rocketraman@gmail.com>
Date
Jul 28, 2017, 18:40 UTC
Message-ID
<c522f452-0b30-3408-1673-8b62ffb7f039@gmail.com>
In-Reply-To
<xmqq60efq6bo.fsf@gitster.mtv.corp.google.com>
On 26/07/17 04:41 PM, Junio C Hamano wrote:
Show 27 quoted lines
> Raman Gupta <rocketraman@gmail.com> writes:
> 
>> On 26/07/17 02:05 PM, Junio C Hamano wrote:
>>> I haven't tried this patch, but would this work well with options
>>> meant for the 'git rev-list --parents "$@"' that grabs the list of
>>> merge commits to learn from?  e.g.
>>>
>>> 	$ contrib/rerere-train.sh -n 4 --merges master
>>> 	$ contrib/rerere-train.sh --overwrite -n 4 --merges master
>>> 	$ contrib/rerere-train.sh -n 4 --overwrite --merges master
>>>
>>> I do not think it is necessary to make the last one work; as long as
>>> the first two work as expected, we are good even if the last one
>>> dies with a sensible message e.g. "options X, Y and Z must be given
>>> before other options" (currently "X, Y and Z" consists only of
>>> "--overwrite", but I think you get what I mean).
>>
>> You're right -- I didn't try all the cases. I wasn't able to figure
>> out how to get `rev-parse --parseopt` to deal with this situation, so
>> I did it manually. I'm not super-happy with the result, but it does
>> work. Look for PATCH v3.
> 
> Yes, I think you could squash the two case arms in the later loop
> into one i.e.
> 
> 	-h|--help|-o|--overwrite)
> 		die "please don't." ;;

I considered that but decided the non-collapsed version better supports this list growing in the future.

> but still the repetition does look ugly.
Agreed.
> As a contrib/ material, I do not care too deeply about it, though.
> 
> Will queue.
Thanks.

Regards, Raman

Previous: Junio C HamanoNext: Raman Gupta
Message 7 of 8 in “contrib: rerere-train overwrites existing resolutions”
  1. contrib: rerere-train overwrites existing resolutionsRaman Gupta, Jul 25, 2017
  2. Junio C HamanoJul 25, 2017
  3. contrib/rerere-train: optionally overwrite existing resolutionsRaman Gupta, Jul 25, 2017
  4. Junio C HamanoJul 26, 2017
  5. Raman GuptaJul 26, 2017
  6. Junio C HamanoJul 26, 2017
  7. Raman GuptaJul 28, 2017
  8. contrib/rerere-train: optionally overwrite existing resolutionsRaman Gupta, Jul 26, 2017

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.