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

Re: [PATCH] advice: Add advice.scissors to suppress "do not modify or remove this line"

From
DSDragan Simic <dsimic@manjaro.org>
Date
Apr 17, 2024, 04:00 UTC
Message-ID
<9eede976d6be7a93199f9d53e916431a@manjaro.org>
In-Reply-To
<xmqqv84hc53e.fsf@gitster.g>
Hello all,
Please see my comments below.
On 2024-04-17 00:31, Junio C Hamano wrote:
Show 21 quoted lines
> <rsbecker@nexbridge.com> writes:
>> I am having a bit of trouble understanding the use-case for
>> this. Is it limited to linkgit? Under what circumstances would I
>> need to use such capabilities?
> 
> When you run "git commit" from the command line without specifying
> any message, you'd get an editor spawned for you with something like
> this in the file ("--- >8 ---" and "--- 8< ---" are for illustration
> purposes in this message).
> 
>     --- >8 ---
> 
>     # Please enter the commit message for your changes. Lines starting
>     # with '#' will be ignored, and an empty message aborts the commit.
>     #
>     # On branch next
>     # Untracked files:
>     #	+runme.sh
>     #	P
>     #
>     --- 8< ---

Frankly, I'd much rather see a new configuration option that would suppress the two leading lines in the example above. Of course, they'd still be displayed by default.

Show 18 quoted lines
> But when you run "git commit --cleanup=scissors" (or use the
> equivalent configuration variables), you'd get this instead.
> 
>     --- >8 ---
> 
>     # ------------------------ >8 ------------------------
>     # Do not modify or remove the line above.
>     # Everything below it will be ignored.
>     #
>     # On branch next
>     # Untracked files:
>     #	+runme.sh
>     #	P
>     #
>     --- 8< ---
> 
> The new advice configuration is to suppress the two lines from that
> message template.

I think this new configuration option might be useful to some users, but I'd suggest that it gets extended to also suppress the two opening lines mentioned in my comment on the first example above.

Show 8 quoted lines
> I agree that a bit more background information should be given in
> the proposed log message to help readers.  It should mention when
> this new setting is relevant (e.g., when the "--cleanup=scissors"
> option is in effect), at least.
> 
> I suspect that the same configuration variable wants to also control
> the "helpful" comment in the "normal" case, in which case the name
> of the configuration variable would need to be rethought.
Agreed, a better name for the new option would be helpful.
Previous: rsbecker@nexbridge.comNext: Rubén Justo
Message 7 of 8 in “advice: Add advice.scissors to suppress "do not modify or remove this line"”
  1. advice: Add advice.scissors to suppress "do not modify or remove this line"Josh Triplett, Feb 26, 2024
  2. Josh TriplettApr 16, 2024
  3. Junio C HamanoApr 16, 2024
  4. rsbecker@nexbridge.comApr 16, 2024
  5. Junio C HamanoApr 16, 2024
  6. rsbecker@nexbridge.comApr 16, 2024
  7. Dragan SimicApr 17, 2024
  8. Rubén JustoApr 16, 2024

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.