Re: Feature request: Configurable prefixes for git commit --fixup and --squash

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

 



Hi John,
yes, it can be anywhere in the commit message and I already thought
about using a hook for generating the commit message too, but the
problem is then, that `git rebase` won't pair up the commit for
squashing/fixing up with the original commit.

Maybe another approach could be to allow for a configuration of a
string that is ignored when matching the commit messages in `git
rebase`.

Regards,
Martine

Am 03.03.2016 14:21 schrieb "John Keeping" <john@xxxxxxxxxxxxx>:
>
> On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:
> > I'm not sure if this was already requested somewhere (a quick - but
> > admittedly not thorough - search did not reveal anything in that
> > direction), but I really miss an option to configure the prefixes generated
> > by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase
> > -i --autosquash`.
> >
> > My reasoning is that in our project we use GitHub + Travis to test-build
> > our pull requests, but we don't want to spam the CI server with builds that
> > are just fixups to previous changes (which are uploaded so reviewers can
> > track the changes to the original PR). Now, Travis has the option to not
> > build a commit if there is the string `[ci skip]` in the commit message
> > (sadly also not configurable) so it would be really great for my workflow
> > if I could just add this string to the message generated by `--fixup`.
>
> I am against the feature as you describe it, because it has the
> potential to break `git rebase --autosquash` with shared fixups if two
> people are using a different prefix.
>
> However, it sounds like Travis will recognize "[ci skip]" anywhere in
> the commit message.  Would a feature to allow autogenerated content in
> fixup/squash commit message bodies work?
>
> In fact, this can already be achieved with a prepare-commit-msg hook
> like this (untested, but shows the principle):
>
> -- >8 --
> #!/bin/sh
> case "$(head -n 1 "$1")" in
> "fixup! "*|"squash! "*)
>         cat >>"$1" <<-\EOF
>
>         [ci skip]
>         EOF
> esac
--
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]