* Feature request: Configurable prefixes for git commit --fixup and --squash
@ 2016-03-03 12:47 Martine Lenders
2016-03-03 13:21 ` John Keeping
0 siblings, 1 reply; 12+ messages in thread
From: Martine Lenders @ 2016-03-03 12:47 UTC (permalink / raw)
To: git
Hi,
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`.
Thanks in advance for your consideration.
Kind Regards,
Martine Lenders
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 12:47 Feature request: Configurable prefixes for git commit --fixup and --squash Martine Lenders
@ 2016-03-03 13:21 ` John Keeping
2016-03-03 13:58 ` Matthieu Moy
2016-03-03 14:33 ` Martine Lenders
0 siblings, 2 replies; 12+ messages in thread
From: John Keeping @ 2016-03-03 13:21 UTC (permalink / raw)
To: authmillenon; +Cc: git
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 13:21 ` John Keeping
@ 2016-03-03 13:58 ` Matthieu Moy
2016-03-03 14:38 ` Martine Lenders
2016-03-03 14:33 ` Martine Lenders
1 sibling, 1 reply; 12+ messages in thread
From: Matthieu Moy @ 2016-03-03 13:58 UTC (permalink / raw)
To: John Keeping; +Cc: authmillenon, git
John Keeping <john@keeping.me.uk> writes:
> 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?
Or, alternatively: change the script used by Travis-CI to do something
like
case "$(head -n 1 "$1")" in
"fixup! "*|"squash! "*)
: do nothing
;;
*)
launch_real_tests
esac
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 13:58 ` Matthieu Moy
@ 2016-03-03 14:38 ` Martine Lenders
2016-03-03 14:52 ` Matthieu Moy
0 siblings, 1 reply; 12+ messages in thread
From: Martine Lenders @ 2016-03-03 14:38 UTC (permalink / raw)
To: git; +Cc: John Keeping, Matthieu Moy
Hi Matthieu,
We already do this :-). But sadly, this won't help: [ci skip]
encourages Travis-CI to do nothing at all, while your proposed
solution will at least require Travis to boot up a VM (or in case of a
build matrix several VMs). In our case, including queueing this can
take up to 1h.
Just in case you think I did not consider this: There is an issue on
Travis' issue tracker [1], which is proposing to make this string
configurable on their side, but sadly there was no reaction to that up
until now.
Regards,
Martine
[1] https://github.com/travis-ci/travis-ci/issues/4624
2016-03-03 14:58 GMT+01:00 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:
> John Keeping <john@keeping.me.uk> writes:
>
>> 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?
>
> Or, alternatively: change the script used by Travis-CI to do something
> like
>
> case "$(head -n 1 "$1")" in
> "fixup! "*|"squash! "*)
> : do nothing
> ;;
> *)
> launch_real_tests
> esac
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 14:38 ` Martine Lenders
@ 2016-03-03 14:52 ` Matthieu Moy
0 siblings, 0 replies; 12+ messages in thread
From: Matthieu Moy @ 2016-03-03 14:52 UTC (permalink / raw)
To: Martine Lenders; +Cc: git, authmillenon, John Keeping
[ Please, don't top-post on this list ]
Martine Lenders <mlenders@riot-os.org> writes:
> Hi Matthieu,
> We already do this :-). But sadly, this won't help: [ci skip]
> encourages Travis-CI to do nothing at all, while your proposed
> solution will at least require Travis to boot up a VM (or in case of a
> build matrix several VMs). In our case, including queueing this can
> take up to 1h.
Ah, indeed. Booting a VM just to execute "if fixup, do nothing" is a bit
overkill ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 13:21 ` John Keeping
2016-03-03 13:58 ` Matthieu Moy
@ 2016-03-03 14:33 ` Martine Lenders
2016-03-03 14:44 ` John Keeping
2016-03-03 15:59 ` Matthieu Moy
1 sibling, 2 replies; 12+ messages in thread
From: Martine Lenders @ 2016-03-03 14:33 UTC (permalink / raw)
To: git; +Cc: john
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@keeping.me.uk>:
>
> 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 14:33 ` Martine Lenders
@ 2016-03-03 14:44 ` John Keeping
2016-03-03 15:59 ` Matthieu Moy
1 sibling, 0 replies; 12+ messages in thread
From: John Keeping @ 2016-03-03 14:44 UTC (permalink / raw)
To: authmillenon; +Cc: git
[please don't top post on this list]
On Thu, Mar 03, 2016 at 03:33:34PM +0100, Martine Lenders wrote:
> 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.
Huh? With the hook below you just run `git commit --fixup=...` as
normal and it appends a "[ci skip]" line to the bottom of the commit
message.
> Am 03.03.2016 14:21 schrieb "John Keeping" <john@keeping.me.uk>:
> >
> > 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 14:33 ` Martine Lenders
2016-03-03 14:44 ` John Keeping
@ 2016-03-03 15:59 ` Matthieu Moy
2016-03-03 16:48 ` Martine Lenders
1 sibling, 1 reply; 12+ messages in thread
From: Matthieu Moy @ 2016-03-03 15:59 UTC (permalink / raw)
To: Martine Lenders; +Cc: git, authmillenon, john
Martine Lenders <mlenders@riot-os.org> writes:
> 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.
It won't match if you put it in the subject line, but John's proposal is
to put it at the bottom (i.e. in the body). This won't disturb "git
rebase --autosquash".
> Maybe another approach could be to allow for a configuration of a
> string that is ignored when matching the commit messages in `git
> rebase`.
I wish I could write commit messages like
fixup! deadbeef: fix typo (foo -> bar)
So that the commit message contains both the instruction for "rebase
--autosquash" and a quick explanation of what the commit is doing (as
usual commit messages).
AFAIK, it's not possible currently but shouldn't be hard to implement.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 15:59 ` Matthieu Moy
@ 2016-03-03 16:48 ` Martine Lenders
2016-03-03 17:09 ` Matthieu Moy
0 siblings, 1 reply; 12+ messages in thread
From: Martine Lenders @ 2016-03-03 16:48 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git, authmillenon, John Keeping
> [ Please, don't top-post on this list ]
Sorry (*^.^*)
> It won't match if you put it in the subject line, but John's proposal is
to put it at the bottom (i.e. in the body). This won't disturb "git
rebase --autosquash".
For some reason I did not even consider the bottom. Tried and it
works! Thanks! I will integrate this into my workflow (and try to get
other contributors to our project to do the same).
>> Maybe another approach could be to allow for a configuration of a
>> string that is ignored when matching the commit messages in `git
>> rebase`.
>
> I wish I could write commit messages like
>
> fixup! deadbeef: fix typo (foo -> bar)
>
> So that the commit message contains both the instruction for "rebase
> --autosquash" and a quick explanation of what the commit is doing (as
> usual commit messages).
>
> AFAIK, it's not possible currently but shouldn't be hard to implement.
I would love that, too :-). This differs however from the original
intent of my feature request. So maybe we finish this thread (since my
John's proposal is 100% sufficient for me in that regard) and open a
new one? How are the procedures for this on this list?
Regards,
Martine
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 16:48 ` Martine Lenders
@ 2016-03-03 17:09 ` Matthieu Moy
2016-03-03 17:23 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Matthieu Moy @ 2016-03-03 17:09 UTC (permalink / raw)
To: Martine Lenders; +Cc: authmillenon, git, John Keeping
Martine Lenders <mlenders@riot-os.org> writes:
>> [ Please, don't top-post on this list ]
... and as much as possible keep the "XYZ wrote:" line so that we know
who wrote what ;-).
I wrote:
>> I wish I could write commit messages like
>>
>> fixup! deadbeef: fix typo (foo -> bar)
>>
>> So that the commit message contains both the instruction for "rebase
>> --autosquash" and a quick explanation of what the commit is doing (as
>> usual commit messages).
>>
>> AFAIK, it's not possible currently but shouldn't be hard to implement.
>
> I would love that, too :-). This differs however from the original
> intent of my feature request. So maybe we finish this thread (since my
> John's proposal is 100% sufficient for me in that regard) and open a
> new one? How are the procedures for this on this list?
We don't have "procedure" for feature requests. It happens often that
someone dreams aloud like I did above, and it's OK as long as "it
shouldn't be hard to implement" is understood as "one day I should do
it" and not "hey, you lazy devs, why don't you code that for me?" ;-).
But in general, people get more interested when a proposal has a patch
attached.
I've added the idea here:
https://git.wiki.kernel.org/index.php/SmallProjectsIdeas
(except I already changed my mind in the syntax)
I may get some students to work on this in May, or do it myself one day.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 17:09 ` Matthieu Moy
@ 2016-03-03 17:23 ` Junio C Hamano
2016-03-03 17:34 ` Matthieu Moy
0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2016-03-03 17:23 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Martine Lenders, authmillenon, git, John Keeping
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> We don't have "procedure" for feature requests. It happens often that
> someone dreams aloud like I did above, and it's OK as long as "it
> shouldn't be hard to implement" is understood as "one day I should do
> it" and not "hey, you lazy devs, why don't you code that for me?" ;-).
;-)
> I may get some students to work on this in May, or do it myself one day.
I envy teachers who can say "hey, code this for me if you want
course credits".
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Feature request: Configurable prefixes for git commit --fixup and --squash
2016-03-03 17:23 ` Junio C Hamano
@ 2016-03-03 17:34 ` Matthieu Moy
0 siblings, 0 replies; 12+ messages in thread
From: Matthieu Moy @ 2016-03-03 17:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Martine Lenders, authmillenon, git, John Keeping
Junio C Hamano <gitster@pobox.com> writes:
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> I may get some students to work on this in May, or do it myself one day.
>
> I envy teachers who can say "hey, code this for me if you want
> course credits".
Well, in practice it's often still more work to supervise students than
to do the work myself, but supervising students is what I'm paid
for ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2016-03-03 17:34 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 12:47 Feature request: Configurable prefixes for git commit --fixup and --squash Martine Lenders
2016-03-03 13:21 ` John Keeping
2016-03-03 13:58 ` Matthieu Moy
2016-03-03 14:38 ` Martine Lenders
2016-03-03 14:52 ` Matthieu Moy
2016-03-03 14:33 ` Martine Lenders
2016-03-03 14:44 ` John Keeping
2016-03-03 15:59 ` Matthieu Moy
2016-03-03 16:48 ` Martine Lenders
2016-03-03 17:09 ` Matthieu Moy
2016-03-03 17:23 ` Junio C Hamano
2016-03-03 17:34 ` Matthieu Moy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).