On 28/04/2014 17:37, Junio C Hamano wrote:
Christian Couder<chrisc...@tuxfamily.org>  writes:

From: Junio C Hamano<gits...@pobox.com>

Christian Couder<chrisc...@tuxfamily.org>  writes:

+       trailer. After some alphanumeric characters, it can contain
+       some non alphanumeric characters like ':', '=' or '#' that will
+       be used instead of ':' to separate the token from the value in
+       the trailer, though the default ':' is more standard.

I assume that this is for things like

        bug #538

and the configuration would say something like:

        [trailer "bug"]
                key = "bug #"

For completeness (of this example), the bog-standard s-o-b would
look like

        Signed-off-by: Christian Couder<chrisc...@tuxfamily.org>

and the configuration for it that spell the redundant "key" would

        [trailer "Signed-off-by"]
                key = "Signed-off-by: "

Yeah, but you can use the following instead:

        [trailer "s-o-b"]
                key = "Signed-off-by: "

One thing I'm not quite understanding is where the "Christian Couder<chrisc...@tuxfamily.org>" bit comes from. So you've defined the trailer token and key, but interpret-trailers then needs to get the value it will give for the key from somewhere. Does it have to just be hardcoded in? We probably want some way to get various variables like current branch name, current git version, etc. So in the case of always adding a trailer for the branch that the commit was checked in to at the time (Developed-on, Made-on-branch, Author-branch, etc. [I think my favourite is Made-on-branch]), you'd want something like:

        [trailer "m-o-b"]
                key = "Made-on-branch: "
                value = "$currentBranch"

... resulting in the trailer (for example):
        Made-on-branch: pacman-minigame

Also, if there were no current branch name because you're committing in a detached head state, it would be nice if you could have some logic to determine that, and instead write the trailer as:
        Made-on-branch: (detached HEAD: AB12CD34)

... or whatever. And also how about some logic to be able to say that if you're committing to the "master" branch, the trailer doesn't get inserted at all?

Best regards,
Jeremy Morton (Jez)
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to