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

Re: [PATCH 1/2] add--interactive: ignore mode change in 'p'atch command

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 27, 2008, 18:29 UTC
Message-ID
<7vprtg9g0p.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080327171022.GA27189@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> On Thu, Mar 27, 2008 at 09:24:10AM -0700, Junio C Hamano wrote:
>
>>     similarity index 90%
>>     rename from gostak
>>     rename to doshes
>>     Stage the name change [y/n/a/d/j/J/?]?
>
> I hadn't thought about renames. But I wonder if it really makes sense in
> the context of a single path.

Yeah, but the user is really into microcommits, like "separate mode change" thing really matters, maybe the user would want to make three commits (1) chmod +x, (2) pure rename, and (3) content changes.

I personally think that is not worth it, so I am agreeing with you on the "rename" one.

Even though your two patches make perfect sense at the philosophical level and I very much like it, I doubt "separating mode change" is so useful from the practical point of view for that matter.

I would even imagine that, if we did not have "add -p" before, and the very initial implementation of it had started from the behaviour your two patches bring in, and then a patch came to make it the current "not asking about mode change separately and if the user chooses to add anything from the patch hunks, stage the mode change along with it" behaviour, people might even think that such a patch is an improvement in usability by asking one less question. I dunno.

>> By the way, why was it done as a new sub called from parse_diff() and not
>> as a part of parse_diff() itself?
>
> Code clarity.
That I'd agree with very much.  Thanks for clarificaiton.
Previous: Jeff KingNext: Jeff King
Message 4 of 7 in “add--interactive: ignore mode change in 'p'atch command”
  1. 1/2 add--interactive: ignore mode change in 'p'atch commandJeff King, Mar 27, 2008
  2. Junio C HamanoMar 27, 2008
  3. Jeff KingMar 27, 2008
  4. Junio C HamanoMar 27, 2008
  5. Jeff KingMar 27, 2008
  6. 2/2 add--interactive: allow user to choose mode updateJeff King, Mar 27, 2008
  7. Jeff KingMar 27, 2008

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.