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

Re: [PATCH/RFC/GSoC 0/2] add a add.patch config variable

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 21, 2016, 16:43 UTC
Message-ID
<vpqr3dyud3i.fsf@anie.imag.fr>
In-Reply-To
<34fb607f-1c4c-528a-cb5d-eca95e0e7c68@web.de>
Dominik Fischer <d.f.fischer@web.de> writes:
Show 6 quoted lines
> I strove to create an add.patch configuration option that did the same
> as always passing the parameter --patch to git-add. Junio C Hamano
> then made me aware that when set, this option would influence and
> possibly destroy other commands that internally use git-add. So I
> implemented the recursion counter, which is now the first of the two
> commits.

This does not solve the problem of scripting. People write scripts, and write git commands in these scripts. "git add" is a very good candidate to appear in scripts, indeed.

You can't break people's scripts without a very solid transition plan. And most of the time, safe transition plans are also painful for everyone (remember the push.default change? I'm happy it's done, but that wasn't a lightweight change ...).

In this case, it's quite clear to me that any transition plan would be far more painful than the possible benefits. Without breaking backward compatibility, I can already set "alias.p = add --patch" and use "git p" instead of "git add --patch". Even better: that's 2 less keystrokes.

A config variable to set an option by default is good when the user wants to set it and forget about it. In this case, you clearly can't "forget about it", as running "git add" and "git add -p" correspond to really different use-cases.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Dominik FischerNext: Junio C Hamano
Message 6 of 10 in “add a add.patch config variable”
  1. 0/2 add a add.patch config variableXZS, Apr 21, 2016
  2. 1/2 count recursion depthXZS, Apr 21, 2016
  3. 2/2 add a add.patch config variableXZS, Apr 21, 2016
  4. Johannes SchindelinApr 21, 2016
  5. Dominik FischerApr 21, 2016
  6. Matthieu MoyApr 21, 2016
  7. Junio C HamanoApr 21, 2016
  8. Dominik FischerApr 21, 2016
  9. Johannes SchindelinApr 22, 2016
  10. Johannes SchindelinApr 22, 2016

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.