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

Re: serious problem with `git format-patch' & `git am'

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 27, 2009, 17:53 UTC
Message-ID
<7vr61jkbpt.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<zE3C931NyNaTaadZOgAI_rGf6gmkKr-3ZHRVXh87mHpCMs-0hfnhYg@cipher.nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 9 quoted lines
> What does this line do?
>
> git-am.sh line 375:
>
>     case "$keep_subject" in -k)  SUBJECT="[PATCH] $SUBJECT" ;; esac
>
> It appears to do nothing.  It has existed since the beginning of git-am.sh,
> and there has never been another reference to $keep_subject in this script.
> Is it possible that $keep_subject is supposed to be $keep?

I do not think it is doing anything, and I do not think it makes sense to "fix" it to allow adding "[PATCH] " in front either. I'd vote for removing the entire thing.

The $keep_subject variable and "add [PATCH] only to later strip" logic was borrowed from git-applymbox and git-applypatch pair, see 6bff6a6 (Teach applymbox to keep the Subject: line., 2005-08-16) especially for the change that affects tools/git-applypatch in the commit. I think there was a reason that -k refrained from adding the prefix in git-applypatch but the option to git-am needed to add the prefix which seems inconsistent but I do not recall the details. Maybe the list archive may know.

Previous: Brandon CaseyNext: Werner LEMBERG
Message 7 of 8 in “serious problem with `git format-patch' & `git am'”
  1. Werner LEMBERGFeb 25, 2009
  2. Johannes SchindelinFeb 26, 2009
  3. Brandon CaseyFeb 26, 2009
  4. Jakub NarebskiFeb 27, 2009
  5. Junio C HamanoFeb 27, 2009
  6. Brandon CaseyFeb 27, 2009
  7. Junio C HamanoFeb 27, 2009
  8. Werner LEMBERGFeb 27, 2009

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.