Comment 2 for bug 1130330

Revision history for this message
Timo Tijhof (krinklemail) wrote :

I don't have any preference for the desired behaviour. Just as long as it doesn't override my local branch name, causing me having to have to think twice about whether I used the word "bug" in my commit message and remember to pass -t, which feels silly.

Perhaps restrict #3 and #4 to the first line (or first few lines up until the first line break, to be conforming with Git/Gerrit/GitHub's concept of commit message "subject" vs. "body"), so that it isn't influenced by a mention of "bug" later in the commit message body.

It is only for creating a better default topic name, shouldn't do any harm if it doesn't auto-guess it. Only good (in that is prevents false positives such as the one in the opening post where it isn't a suggestion but actually overriding a valid and intended topic branch name).

Personally I'd rather only have #1 and #5 (and #2, which is like #5) and delete #3 and #4 entirely (I'd never use them, and when I do it is by accident and regret it the minute I find out). I name my branches for a reason so unless I override it with -t that's what I want, regardless of what words may appear in my commit message.

But, I do see the usefulness in naming them automatically as a convenience for users who aren't in the habit of properly branching lcoally, so maybe only do #3 and #4 if the local branch name indicates this kind of user (e.g. where branch name is the name of gerrit/HEAD (e.g. "master") or "(no branch")).

Anyhow, whether restricting it to the first few lines or to non-topic branch names or some other clever approach, I just want to not have to use -t <topic> or push HEAD:refs/for/master/<topic> when using a fine topic name as branch name.