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

Re: [PATCH] cherry-pick: Add an option to prepend a string to the commit message

From
Jeff King <peff@peff.net>
Date
Jun 12, 2010, 08:19 UTC
Message-ID
<20100612081925.GA19525@coredump.intra.peff.net>
In-Reply-To
<20100612071850.GA2765@burratino>
On Sat, Jun 12, 2010 at 02:18:50AM -0500, Jonathan Nieder wrote:
Show 6 quoted lines
> Subject: Documentation: explain use of cherry-pick -n in scripts
> 
> Add an example to indicate how to munge a commit while cherry-picking it.
> 
> The formatting is ugly because I do not know how to ask asciidoc to
> use a multiline heading in a definition list.

I don't think there is a way to do what you want. Even an explicit " +" at the end of line, which is supposed to cause a line-break, doesn't seem to work.

However, I wonder if all of the examples should actually be in "----" listing blocks. That would generally render them in a monospaced typewriter font (though in the manpage, it doesn't matter much), and your multiline addition would be rendered properly, too.

Show 7 quoted lines
> +------------
> +git checkout maint &&
> +git cherry-pick -n bugfix &&
> +git add new_file.txt &&
> +git show -s bugfix --format='%s%n%n%b%n%nAlso add a new file.' |
> +git commit -F -
> +------------

You can use the much shorter "%B" instead of "%s%n%n%b" these days, and as a bonus, it will use the right number of newlines for a subject-only commit.

-Peff
Previous: Jonathan NiederNext: Junio C Hamano
Message 7 of 9 in “cherry-pick: Add an option to prepend a string to the commit message”
  1. cherry-pick: Add an option to prepend a string to the commit messageBobby Powers, Jun 12, 2010
  2. Jonathan NiederJun 12, 2010
  3. Junio C HamanoJun 12, 2010
  4. Jeff KingJun 12, 2010
  5. Bobby PowersJun 12, 2010
  6. Jonathan NiederJun 12, 2010
  7. Jeff KingJun 12, 2010
  8. Junio C HamanoJun 14, 2010
  9. Junio C HamanoJun 14, 2010

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.