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

Re: [PATCH] Add support for commit attributes

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 10, 2014, 17:22 UTC
Message-ID
<xmqqk3axxfoh.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CACsJy8BJw3+=vSHzfBYigoK6ejt-DNHJPTcOWS3Nv=zxpF1f7g@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 6 quoted lines
> If the problem is polluting human eyes, wouldn't it be better to make
> git-log to filter it out? For example, we could tell git that all
> fields (in the message body) that start with X- are "rubbish", so
> instead of showing "X-something: base64 stuff...", it shows
> "X-something: <filtered out>" instead? At least people will see that
> this commit carries human-unreadable stuff.

We had lengthy discussions in early 2010 [*1*]. The whole thread, at least the whole sub-thread that contains the focused message, is a required reading to understand where we stand with respect to "extra headers in commit objects".

"Any additional information about the commit can be added" this patch implements is exactly the kind of thing we want to avoid, which made Linus say in an even older discussion [*2*]:

    No "this random field could be used this random way" crud, please.

Even worse, the "--attr" pretends to be opaque by not defining what each "attribute" really means, but the patch hardcodes arbitrary rules like "an attribute is unconditionally copied during amends" and "an attribute cannot be multi-valued", if I read it correctly.

I actually think this "recording information about commits" is exactly the use-case notes were invented to address, and if it is found cumbersome to use, the reason why it is cumbersome needs to be discovered and use of notes needs to be improved. Hooks and/or a wrapper around "git commit" to implement their custom workflow may be involved as part of the solution and "git notes" may need to learn a new trick or two along the way.

I am not interested in hearing "let's add random crud to commit object header" before "let's improve notes so that it can be more smoothly used" is fully explored.

[References]
*1* http://thread.gmane.org/gmane.comp.version-control.git/138848/focus=138892
*2* http://thread.gmane.org/gmane.comp.version-control.git/19126/focus=19149
Previous: Diego Lago GonzálezNext: Junio C Hamano
Message 4 of 8 in “Add support for commit attributes”
  1. Add support for commit attributesDiego Lago, Apr 9, 2014
  2. Duy NguyenApr 10, 2014
  3. Diego Lago GonzálezApr 10, 2014
  4. Junio C HamanoApr 10, 2014
  5. Junio C HamanoApr 10, 2014
  6. Felipe ContrerasApr 10, 2014
  7. Max HornApr 10, 2014
  8. Duy NguyenApr 10, 2014

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.