Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formatting commit messages

Tags:

git

svn

I recently migrated a repository to git from svn. When I look at the log, all the commits from SVN are not properly formatted in the 50/72 format. Is there a way that I can go through every commit message and edit it so that it conforms to git format?

like image 813
EnactSchmenact Avatar asked Jun 07 '13 16:06

EnactSchmenact


1 Answers

You said in a comment:

The repository was migrated over a week ago and already has commits on it made in Git.

As such, the best option is to simply live with it and keep making correct commit messages from now on.

All methods that would change the commit messages in those old commits would change the commits and create completely new objects with different IDs. As such the repositories of everyone who is already working with it would break, requiring them to manually reset to the new, rewritten state of the repository.

That ends just in a lot more work (and confusion!) than necessary for the trivial matter of commits with a non-perfect commit message which were migrated from an old system. I think it’s perfectly fine to have some old history, from the days before, which does not fit perfectly into the current standards. You wouldn’t rewrite all commits if you later decide to change your code formatting rules either.

like image 138
poke Avatar answered Sep 18 '22 22:09

poke