{"thread":{"id":"41599","subject":"Feature request: Configurable prefixes for git commit --fixup and --squash","startedAt":"2016-03-03T12:47:00Z","lastAt":"2016-03-03T17:34:10Z","messageCount":12,"participants":["Martine Lenders","John Keeping","Matthieu Moy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"280111","messageId":"CALHmdRz3ffgifH2BZK14B=4LGFqOeTWpRarD+RAFx8AtwwMidg@mail.gmail.com","threadId":"41599","inReplyTo":null,"subject":"Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Martine Lenders","fromEmail":"mlenders@riot-os.org","sentAt":"2016-03-03T12:47:00Z","receivedAt":"2016-03-03T12:47:00Z","isPatch":false,"sender":{"key":"mlenders@riot-os.org","avatar":null},"body":"Hi,\nI'm not sure if this was already requested somewhere (a quick - but\nadmittedly not thorough - search did not reveal anything in that\ndirection), but I really miss an option to configure the prefixes generated\nby `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n-i --autosquash`.\n\nMy reasoning is that in our project we use GitHub + Travis to test-build\nour pull requests, but we don't want to spam the CI server with builds that\nare just fixups to previous changes (which are uploaded so reviewers can\ntrack the changes to the original PR). Now, Travis has the option to not\nbuild a commit if there is the string `[ci skip]` in the commit message\n(sadly also not configurable) so it would be really great for my workflow\nif I could just add this string to the message generated by `--fixup`.\n\nThanks in advance for your consideration.\n\nKind Regards,\nMartine Lenders\n"},{"id":"280115","messageId":"20160303132128.GE1766@serenity.lan","threadId":"41599","inReplyTo":"CALHmdRz3ffgifH2BZK14B=4LGFqOeTWpRarD+RAFx8AtwwMidg@mail.gmail.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2016-03-03T13:21:28Z","receivedAt":"2016-03-03T13:21:28Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:\n> I'm not sure if this was already requested somewhere (a quick - but\n> admittedly not thorough - search did not reveal anything in that\n> direction), but I really miss an option to configure the prefixes generated\n> by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n> -i --autosquash`.\n> \n> My reasoning is that in our project we use GitHub + Travis to test-build\n> our pull requests, but we don't want to spam the CI server with builds that\n> are just fixups to previous changes (which are uploaded so reviewers can\n> track the changes to the original PR). Now, Travis has the option to not\n> build a commit if there is the string `[ci skip]` in the commit message\n> (sadly also not configurable) so it would be really great for my workflow\n> if I could just add this string to the message generated by `--fixup`.\n\nI am against the feature as you describe it, because it has the\npotential to break `git rebase --autosquash` with shared fixups if two\npeople are using a different prefix.\n\nHowever, it sounds like Travis will recognize \"[ci skip]\" anywhere in\nthe commit message.  Would a feature to allow autogenerated content in\nfixup/squash commit message bodies work?\n\nIn fact, this can already be achieved with a prepare-commit-msg hook\nlike this (untested, but shows the principle):\n\n-- >8 --\n#!/bin/sh\ncase \"$(head -n 1 \"$1\")\" in\n\"fixup! \"*|\"squash! \"*)\n\tcat >>\"$1\" <<-\\EOF\n\n\t[ci skip]\n\tEOF\nesac\n"},{"id":"280116","messageId":"vpqio13ll3i.fsf@anie.imag.fr","threadId":"41599","inReplyTo":"20160303132128.GE1766@serenity.lan","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-03T13:58:09Z","receivedAt":"2016-03-03T13:58:09Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n> On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:\n>> I'm not sure if this was already requested somewhere (a quick - but\n>> admittedly not thorough - search did not reveal anything in that\n>> direction), but I really miss an option to configure the prefixes generated\n>> by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n>> -i --autosquash`.\n>> \n>> My reasoning is that in our project we use GitHub + Travis to test-build\n>> our pull requests, but we don't want to spam the CI server with builds that\n>> are just fixups to previous changes (which are uploaded so reviewers can\n>> track the changes to the original PR). Now, Travis has the option to not\n>> build a commit if there is the string `[ci skip]` in the commit message\n>> (sadly also not configurable) so it would be really great for my workflow\n>> if I could just add this string to the message generated by `--fixup`.\n>\n> I am against the feature as you describe it, because it has the\n> potential to break `git rebase --autosquash` with shared fixups if two\n> people are using a different prefix.\n>\n> However, it sounds like Travis will recognize \"[ci skip]\" anywhere in\n> the commit message.  Would a feature to allow autogenerated content in\n> fixup/squash commit message bodies work?\n\nOr, alternatively: change the script used by Travis-CI to do something\nlike\n\ncase \"$(head -n 1 \"$1\")\" in\n\"fixup! \"*|\"squash! \"*)\n\t: do nothing\n        ;;\n*)\n\tlaunch_real_tests\nesac\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"280117","messageId":"CALHmdRwgDjRJMQSPzp34aS25ZHg-mr458QeyYgyp85q8g34Aig@mail.gmail.com","threadId":"41599","inReplyTo":"20160303132128.GE1766@serenity.lan","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Martine Lenders","fromEmail":"mlenders@riot-os.org","sentAt":"2016-03-03T14:33:34Z","receivedAt":"2016-03-03T14:33:34Z","isPatch":false,"sender":{"key":"mlenders@riot-os.org","avatar":null},"body":"Hi John,\nyes, it can be anywhere in the commit message and I already thought\nabout using a hook for generating the commit message too, but the\nproblem is then, that `git rebase` won't pair up the commit for\nsquashing/fixing up with the original commit.\n\nMaybe another approach could be to allow for a configuration of a\nstring that is ignored when matching the commit messages in `git\nrebase`.\n\nRegards,\nMartine\n\nAm 03.03.2016 14:21 schrieb \"John Keeping\" <john@keeping.me.uk>:\n>\n> On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:\n> > I'm not sure if this was already requested somewhere (a quick - but\n> > admittedly not thorough - search did not reveal anything in that\n> > direction), but I really miss an option to configure the prefixes generated\n> > by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n> > -i --autosquash`.\n> >\n> > My reasoning is that in our project we use GitHub + Travis to test-build\n> > our pull requests, but we don't want to spam the CI server with builds that\n> > are just fixups to previous changes (which are uploaded so reviewers can\n> > track the changes to the original PR). Now, Travis has the option to not\n> > build a commit if there is the string `[ci skip]` in the commit message\n> > (sadly also not configurable) so it would be really great for my workflow\n> > if I could just add this string to the message generated by `--fixup`.\n>\n> I am against the feature as you describe it, because it has the\n> potential to break `git rebase --autosquash` with shared fixups if two\n> people are using a different prefix.\n>\n> However, it sounds like Travis will recognize \"[ci skip]\" anywhere in\n> the commit message.  Would a feature to allow autogenerated content in\n> fixup/squash commit message bodies work?\n>\n> In fact, this can already be achieved with a prepare-commit-msg hook\n> like this (untested, but shows the principle):\n>\n> -- >8 --\n> #!/bin/sh\n> case \"$(head -n 1 \"$1\")\" in\n> \"fixup! \"*|\"squash! \"*)\n>         cat >>\"$1\" <<-\\EOF\n>\n>         [ci skip]\n>         EOF\n> esac\n"},{"id":"280118","messageId":"CALHmdRwe2d=DwFbNhOB91DQ7rnW7yUTeQZ3td9zef4v2-aOBqg@mail.gmail.com","threadId":"41599","inReplyTo":"vpqio13ll3i.fsf@anie.imag.fr","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Martine Lenders","fromEmail":"mlenders@riot-os.org","sentAt":"2016-03-03T14:38:26Z","receivedAt":"2016-03-03T14:38:26Z","isPatch":false,"sender":{"key":"mlenders@riot-os.org","avatar":null},"body":"Hi Matthieu,\nWe already do this :-). But sadly, this won't help: [ci skip]\nencourages Travis-CI to do nothing at all, while your proposed\nsolution will at least require Travis to boot up a VM (or in case of a\nbuild matrix several VMs). In our case, including queueing this can\ntake up to 1h.\n\nJust in case you think I did not consider this: There is an issue on\nTravis' issue tracker [1], which is proposing to make this string\nconfigurable on their side, but sadly there was no reaction to that up\nuntil now.\n\nRegards,\nMartine\n\n[1] https://github.com/travis-ci/travis-ci/issues/4624\n\n2016-03-03 14:58 GMT+01:00 Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>:\n> John Keeping <john@keeping.me.uk> writes:\n>\n>> On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:\n>>> I'm not sure if this was already requested somewhere (a quick - but\n>>> admittedly not thorough - search did not reveal anything in that\n>>> direction), but I really miss an option to configure the prefixes generated\n>>> by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n>>> -i --autosquash`.\n>>>\n>>> My reasoning is that in our project we use GitHub + Travis to test-build\n>>> our pull requests, but we don't want to spam the CI server with builds that\n>>> are just fixups to previous changes (which are uploaded so reviewers can\n>>> track the changes to the original PR). Now, Travis has the option to not\n>>> build a commit if there is the string `[ci skip]` in the commit message\n>>> (sadly also not configurable) so it would be really great for my workflow\n>>> if I could just add this string to the message generated by `--fixup`.\n>>\n>> I am against the feature as you describe it, because it has the\n>> potential to break `git rebase --autosquash` with shared fixups if two\n>> people are using a different prefix.\n>>\n>> However, it sounds like Travis will recognize \"[ci skip]\" anywhere in\n>> the commit message.  Would a feature to allow autogenerated content in\n>> fixup/squash commit message bodies work?\n>\n> Or, alternatively: change the script used by Travis-CI to do something\n> like\n>\n> case \"$(head -n 1 \"$1\")\" in\n> \"fixup! \"*|\"squash! \"*)\n>         : do nothing\n>         ;;\n> *)\n>         launch_real_tests\n> esac\n>\n> --\n> Matthieu Moy\n> http://www-verimag.imag.fr/~moy/\n"},{"id":"280119","messageId":"20160303144438.GF1766@serenity.lan","threadId":"41599","inReplyTo":"CALHmdRwgDjRJMQSPzp34aS25ZHg-mr458QeyYgyp85q8g34Aig@mail.gmail.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2016-03-03T14:44:38Z","receivedAt":"2016-03-03T14:44:38Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"[please don't top post on this list]\n\nOn Thu, Mar 03, 2016 at 03:33:34PM +0100, Martine Lenders wrote:\n> yes, it can be anywhere in the commit message and I already thought\n> about using a hook for generating the commit message too, but the\n> problem is then, that `git rebase` won't pair up the commit for\n> squashing/fixing up with the original commit.\n\nHuh?  With the hook below you just run `git commit --fixup=...` as\nnormal and it appends a \"[ci skip]\" line to the bottom of the commit\nmessage.\n\n> Am 03.03.2016 14:21 schrieb \"John Keeping\" <john@keeping.me.uk>:\n> >\n> > On Thu, Mar 03, 2016 at 01:47:00PM +0100, Martine Lenders wrote:\n> > > I'm not sure if this was already requested somewhere (a quick - but\n> > > admittedly not thorough - search did not reveal anything in that\n> > > direction), but I really miss an option to configure the prefixes generated\n> > > by `git commit (--fixup | --squash) <commit>` and picked up by `git rebase\n> > > -i --autosquash`.\n> > >\n> > > My reasoning is that in our project we use GitHub + Travis to test-build\n> > > our pull requests, but we don't want to spam the CI server with builds that\n> > > are just fixups to previous changes (which are uploaded so reviewers can\n> > > track the changes to the original PR). Now, Travis has the option to not\n> > > build a commit if there is the string `[ci skip]` in the commit message\n> > > (sadly also not configurable) so it would be really great for my workflow\n> > > if I could just add this string to the message generated by `--fixup`.\n> >\n> > I am against the feature as you describe it, because it has the\n> > potential to break `git rebase --autosquash` with shared fixups if two\n> > people are using a different prefix.\n> >\n> > However, it sounds like Travis will recognize \"[ci skip]\" anywhere in\n> > the commit message.  Would a feature to allow autogenerated content in\n> > fixup/squash commit message bodies work?\n> >\n> > In fact, this can already be achieved with a prepare-commit-msg hook\n> > like this (untested, but shows the principle):\n> >\n> > -- >8 --\n> > #!/bin/sh\n> > case \"$(head -n 1 \"$1\")\" in\n> > \"fixup! \"*|\"squash! \"*)\n> >         cat >>\"$1\" <<-\\EOF\n> >\n> >         [ci skip]\n> >         EOF\n> > esac\n"},{"id":"280120","messageId":"vpq8u1zlikm.fsf@anie.imag.fr","threadId":"41599","inReplyTo":"CALHmdRwe2d=DwFbNhOB91DQ7rnW7yUTeQZ3td9zef4v2-aOBqg@mail.gmail.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-03T14:52:41Z","receivedAt":"2016-03-03T14:52:41Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"[ Please, don't top-post on this list ]\n\nMartine Lenders <mlenders@riot-os.org> writes:\n\n> Hi Matthieu,\n> We already do this :-). But sadly, this won't help: [ci skip]\n> encourages Travis-CI to do nothing at all, while your proposed\n> solution will at least require Travis to boot up a VM (or in case of a\n> build matrix several VMs). In our case, including queueing this can\n> take up to 1h.\n\nAh, indeed. Booting a VM just to execute \"if fixup, do nothing\" is a bit\noverkill ;-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"280122","messageId":"vpq1t7rlfi1.fsf@anie.imag.fr","threadId":"41599","inReplyTo":"CALHmdRwgDjRJMQSPzp34aS25ZHg-mr458QeyYgyp85q8g34Aig@mail.gmail.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-03T15:59:02Z","receivedAt":"2016-03-03T15:59:02Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Martine Lenders <mlenders@riot-os.org> writes:\n\n> Hi John,\n> yes, it can be anywhere in the commit message and I already thought\n> about using a hook for generating the commit message too, but the\n> problem is then, that `git rebase` won't pair up the commit for\n> squashing/fixing up with the original commit.\n\nIt won't match if you put it in the subject line, but John's proposal is\nto put it at the bottom (i.e. in the body). This won't disturb \"git\nrebase --autosquash\".\n\n> Maybe another approach could be to allow for a configuration of a\n> string that is ignored when matching the commit messages in `git\n> rebase`.\n\nI wish I could write commit messages like\n\nfixup! deadbeef: fix typo (foo -> bar)\n\nSo that the commit message contains both the instruction for \"rebase\n--autosquash\" and a quick explanation of what the commit is doing (as\nusual commit messages).\n\nAFAIK, it's not possible currently but shouldn't be hard to implement.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"280126","messageId":"CALHmdRwZCb7LnQcKkdy-wNx5Ree+FcMPz2ykqVnTTq_SPDR_HA@mail.gmail.com","threadId":"41599","inReplyTo":"vpq1t7rlfi1.fsf@anie.imag.fr","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Martine Lenders","fromEmail":"mlenders@riot-os.org","sentAt":"2016-03-03T16:48:18Z","receivedAt":"2016-03-03T16:48:18Z","isPatch":false,"sender":{"key":"mlenders@riot-os.org","avatar":null},"body":"> [ Please, don't top-post on this list ]\n\nSorry (*^.^*)\n\n> It won't match if you put it in the subject line, but John's proposal is\nto put it at the bottom (i.e. in the body). This won't disturb \"git\nrebase --autosquash\".\n\nFor some reason I did not even consider the bottom. Tried and it\nworks! Thanks! I will integrate this into my workflow (and try to get\nother contributors to our project to do the same).\n\n>> Maybe another approach could be to allow for a configuration of a\n>> string that is ignored when matching the commit messages in `git\n>> rebase`.\n>\n> I wish I could write commit messages like\n>\n> fixup! deadbeef: fix typo (foo -> bar)\n>\n> So that the commit message contains both the instruction for \"rebase\n> --autosquash\" and a quick explanation of what the commit is doing (as\n> usual commit messages).\n>\n> AFAIK, it's not possible currently but shouldn't be hard to implement.\n\nI would love that, too :-). This differs however from the original\nintent of my feature request. So maybe we finish this thread (since my\nJohn's proposal is 100% sufficient for me in that regard) and open a\nnew one? How are the procedures for this on this list?\n\nRegards,\nMartine\n"},{"id":"280128","messageId":"vpqvb53ij45.fsf@anie.imag.fr","threadId":"41599","inReplyTo":"CALHmdRwZCb7LnQcKkdy-wNx5Ree+FcMPz2ykqVnTTq_SPDR_HA@mail.gmail.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-03T17:09:14Z","receivedAt":"2016-03-03T17:09:14Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Martine Lenders <mlenders@riot-os.org> writes:\n\n>> [ Please, don't top-post on this list ]\n\n... and as much as possible keep the \"XYZ wrote:\" line so that we know\nwho wrote what ;-).\n\nI wrote:\n>> I wish I could write commit messages like\n>>\n>> fixup! deadbeef: fix typo (foo -> bar)\n>>\n>> So that the commit message contains both the instruction for \"rebase\n>> --autosquash\" and a quick explanation of what the commit is doing (as\n>> usual commit messages).\n>>\n>> AFAIK, it's not possible currently but shouldn't be hard to implement.\n>\n> I would love that, too :-). This differs however from the original\n> intent of my feature request. So maybe we finish this thread (since my\n> John's proposal is 100% sufficient for me in that regard) and open a\n> new one? How are the procedures for this on this list?\n\nWe don't have \"procedure\" for feature requests. It happens often that\nsomeone dreams aloud like I did above, and it's OK as long as \"it\nshouldn't be hard to implement\" is understood as \"one day I should do\nit\" and not \"hey, you lazy devs, why don't you code that for me?\" ;-).\n\nBut in general, people get more interested when a proposal has a patch\nattached.\n\nI've added the idea here:\n\n  https://git.wiki.kernel.org/index.php/SmallProjectsIdeas\n\n(except I already changed my mind in the syntax)\n\nI may get some students to work on this in May, or do it myself one day.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"280130","messageId":"xmqq7fhj327x.fsf@gitster.mtv.corp.google.com","threadId":"41599","inReplyTo":"vpqvb53ij45.fsf@anie.imag.fr","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-03T17:23:14Z","receivedAt":"2016-03-03T17:23:14Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n> We don't have \"procedure\" for feature requests. It happens often that\n> someone dreams aloud like I did above, and it's OK as long as \"it\n> shouldn't be hard to implement\" is understood as \"one day I should do\n> it\" and not \"hey, you lazy devs, why don't you code that for me?\" ;-).\n\n;-)\n\n> I may get some students to work on this in May, or do it myself one day.\n\nI envy teachers who can say \"hey, code this for me if you want\ncourse credits\".\n"},{"id":"280133","messageId":"vpqpovbh3e5.fsf@anie.imag.fr","threadId":"41599","inReplyTo":"xmqq7fhj327x.fsf@gitster.mtv.corp.google.com","subject":"Re: Feature request: Configurable prefixes for git commit --fixup and --squash","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-03-03T17:34:10Z","receivedAt":"2016-03-03T17:34:10Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n>\n>> I may get some students to work on this in May, or do it myself one day.\n>\n> I envy teachers who can say \"hey, code this for me if you want\n> course credits\".\n\nWell, in practice it's often still more work to supervise students than\nto do the work myself, but supervising students is what I'm paid\nfor ;-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}