Questions tagged [commit-message]

The message associated with commits in a version control system.

Questions marked with this tag may be:

  • about style/how to write helpful messages
  • related to automated commit hooks (be sure to include a tag for the version control system you're using)

Related Tags

Useful Links

117 questions
6
votes
8 answers

How might I force our developers to enter notes when committing via TortoiseSVN?

I often see a slew of commits, but no notes referencing the tickets... And so I end up going back and reviewing the diff manually. Not necessarily bad, but it would be nice to have notes. Any ideas?
Satchel
  • 15,436
  • 22
  • 100
  • 180
5
votes
2 answers

Trigger build in Jenkins/Hudson using hashtag in commit-message

Is it possible to trigger a Hudson/Jenkins build only when a certain string appears in a commit-message? For instance, I want to trigger a build that rolls out my application to the dev environment by writing a commit message like: MYPROJECT-123…
5
votes
6 answers

What is the use of commit messages?

I struggled asking that question but here it is. I am using source control since several years for multiple projects using different systems (svn, hg, git) and I learned how to improve my messages by following guidelines etc. But as far as I can…
ericteubert
  • 4,391
  • 3
  • 29
  • 35
4
votes
2 answers

Git magic keywords in commit messages (Signed-off-by, Co-authored-by, Fixes, ...)

Git command itself supports the Signed-off-by: Person's name line. GitHub adds Co-authored-by: line, which then shows both the committer and the referenced person as commit authors in the UI. Futhermore, GitHub and GitLab each…
user7610
  • 17,196
  • 7
  • 97
  • 120
4
votes
3 answers

Commit message prefix in git

I have a requirement to prepend "ticket:N" to commit messages, where N is the number of the ticket I'm working on. But I keep forgetting about the prefix and remember about it only 5-6 commits later, so --amend won't help. Is it possible to set some…
evgeniuz
  • 2,329
  • 5
  • 26
  • 35
3
votes
1 answer

git: need to parse commit messages looking for pattern and storing in list

all of my git commit messages start with refs #SOME_NUMBER where SOME_NUMBER is a number from 1 up. I would like to parse all commmit messages on my working branch, store all of the SOME_NUMBERs in a list, remove duplicates, and save to file.…
Jacko
  • 11,326
  • 15
  • 66
  • 112
3
votes
1 answer

How to validate and enforce commit message in Mercurial?

What are all steps required to validate commit message with set of regular expressions? We want to work in semi-centralized set-up so I need a solution for the developer clone (local repository) and for our central clone (global repository). I read…
Michal Sznajder
  • 9,088
  • 4
  • 40
  • 62
3
votes
1 answer

svn: revision file lacks trailing newline

I wanted to commit a change in a file that is under subversion control: svn ci some-file -m "some-comment" but I receive a svn: Commit failed (details follow): svn: Revision file lacks trailing newline from a quick search on the internet, I was…
René Nyffenegger
  • 35,550
  • 26
  • 140
  • 232
3
votes
1 answer

Git count filtered commits

Is it possible to get a number of git commits filtered by commit-message? $ git log --all --grep='SEARCH_STRING' With this snippet I get a list of all commits with the searched string. But I got a lot of commits and its hard to count this by…
chrisheyn
  • 774
  • 5
  • 18
3
votes
1 answer

Why are the suggested line lengths for git commits 50 for summaries and 72 for the body?

There is some variation in the exact numbers but in general there are recommended lengths or maximum lengths for the first and subsequent line lengths of commit messages. The common one seems to be at most 72 characters for a message body with a…
TafT
  • 1,786
  • 2
  • 22
  • 41
3
votes
1 answer

Sublime Text line wrap and commit messages

I use Sublime Text (3) for my default Git commit message editor. I try to follow Git conventions using a hard limit on the number of characters per line (50 for the first line and 72 for the rest). I currently have guides set up at those intervals…
RedBassett
  • 2,955
  • 3
  • 27
  • 46
3
votes
1 answer

Is "Merged in" a commit message created by bitbucket, or git?

The style guide "How to Write a Git Commit Message" section 5. Use the imperative mood in the subject line states that git itself uses the imperative mood: The imperative can sound a little rude; that's why we don't often use it. But it's perfect…
Andrew Grimm
  • 70,470
  • 47
  • 186
  • 310
3
votes
1 answer

How to see the content of a commit when rewording its message using 'git rebase'?

I'm fixing some commit messages of a series of commits. I start git rebase --interactive mark some commits for rewording and then edit the messages. It'd be really helpful if I could see the diff of each commit in the editor, just like when doing…
Petr
  • 60,177
  • 8
  • 136
  • 295
2
votes
1 answer

Git: How do I edit the message of a previous commit that is not the latest one?

I just realized that I left one word in the commit message of a previous commit (so I can't use git commit --amend) that makes the message mean completely the opposite of what I had intended. The commit in question is HEAD~2 on my current branch,…
David Sanders
  • 3,782
  • 1
  • 22
  • 34
2
votes
1 answer

Informative message for reverting multiple git commits

When reverting multiple commits using git revert -n f0000000 git revert -n baaaaaaa is it possible to ask git to mention in the new commit message all the commits you've reverted, not just one of the commits? I'm on git version 1.6.3.3, so…
Andrew Grimm
  • 70,470
  • 47
  • 186
  • 310