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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 12, 2010 at 02:18:50AM -0500, Jonathan Nieder wrote:

> 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.

> +------------
> +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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]