Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10093

Make commit-msg hook always not fatal

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0.11-RC1
    • 3.0.8
    • None
    • None

      Given that git can amend commits we can simply make the commit-msg hook always warn instead of error. The committer would keep amending the commit, if they wish, until the warnings go away.

      (19:33:30) bantu: I think I've found another one
      (19:33:37) nn-: with \n ?
      (19:33:44) nn-: its use in sed is unlikely to work
      (19:34:00) nn-: but i don't feel like fixing that right now
      (19:34:35) bantu: you kind of broke it
      (19:34:41) bantu: you're using exit here https://github.com/p/phpbb3/blob/develop-olympus/git-tools/hooks/commit-msg#L251
      (19:35:15) bantu: but there is a git config value https://github.com/p/phpbb3/blob/develop-olympus/git-tools/hooks/commit-msg#L15 that is stupposed to make it only show warnings instead of actually abort
      (19:35:23) bantu: *supposed
      (19:35:52) nn-: i see
      (19:36:05) ***nn- slaps whoever did _not_ document that :p
      (19:36:43) nn-: except your blame is misplaced :p
      (19:37:05) nn-: i did not author that line
      (19:37:55) bantu: right
      (19:38:02) bantu: that's chris' code
      (19:38:24) bantu: Guess I mean https://github.com/p/phpbb3/commit/e55228712831a2422cc1c171a6a1160c20d25f1e
      (19:38:48) nn-: hm
      (19:39:09) bantu: not sure right now
      (19:39:14) bantu: can check that tomorrow again
      (19:39:24) nn-: are you saying it is an entirely useless change if the exit was conditional like it should have been?
      (19:40:13) nn-: i will probably vastly prefer non-fatal behavior
      (19:40:14) bantu: nn-: no, it's not useless
      (19:40:29) nn-: since you can always amend the commit and keep seeing the warnings until you get it right
      (19:40:41) bantu: I guess it just has to use quit instead of exit
      (19:40:45) bantu: yes
      (19:40:50) bantu: that's exactly what I thought
      (19:41:07) bantu: we can just make it non-fatal all the time
      (19:41:08) nn-: i remember now
      (19:41:18) nn-: didn't igorw specifically requested this change? :P
      (19:41:23) bantu: no idea
      (19:41:24) nn-: request*
      (19:41:52) nn-: http://tracker.phpbb.com/browse/PHPBB3-9824
      (19:41:58) nn-: "It would be nice if the message rejection were a bit less strict and a bit more helpful in general. "
      (19:42:02) nn-: that's how i interpreted that
      (19:42:26) bantu: I guess that makes sense

            Oleg Oleg [X] (Inactive)
            Oleg Oleg [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: