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

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

From
DFDominik Fischer <d.f.fischer@web.de>
Date
Mar 25, 2016, 00:43 UTC
Message-ID
<56F489C3.9050400@web.de>
In-Reply-To
<xmqqvb4b7eu9.fsf@gitster.mtv.corp.google.com>
Am 24.03.2016 um 22:20 schrieb Junio C Hamano:
Show 11 quoted lines
> XZS <d.f.fischer@web.de> writes:
>> Users may like to review their changes when staging by default. It is
>> also a convenient safety feature for beginners nudging them to have a
>> second look at their changes when composing a commit.
>>
>> To this end, the config variable allows to have git-add to always act
>> like -p was passed.
>
> Now with such a configuration in her ~/.gitconfig, how would she
> ever run the normal "git add", which perhaps is invoked by one of
> the scripts she regularly uses?  E.g. "git mergetool"?

As the configuration variable can be overwritten by a command line option, I am tempted to amend this by replacing all occurrences of "git add" in other scripts with "git add --no-patch" to ensure the expected behavior.

But this would introduce changes into a vast number of points in the code. Apart from that, I suspect other options may have the same reason not to be available as config variables. It would be much better if git-add could ignore the variable when called internally, only taking it into account when used as an entrypoint.

Is there already a mechanism in place to determine if git was called by git? If not, I could implement one through an environment variable that counts up on each git invocation, essentially providing a git recursion counter.

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “[GSoC] Proposal”
  1. XZSMar 24, 2016
  2. add a add.patch config variableXZS, Mar 24, 2016
  3. Junio C HamanoMar 24, 2016
  4. Dominik FischerMar 25, 2016
  5. Junio C HamanoMar 25, 2016
  6. Christian CouderMar 25, 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.