nachoparker / git-rebasetags

Perform a git rebase operation, restoring original tags
https://ownyourbits.com/2017/08/14/rebasing-in-git-without-losing-tags/
GNU General Public License v3.0
30 stars 5 forks source link

RFC: Adding Author and AuthorDate as matching criteria #3

Open TerraTech opened 7 years ago

TerraTech commented 7 years ago

While updating the large library, I found that several tags were misapplied due to having the same commit message.

In my case, I had added tags to 'go fmt'.

A lot of times, while hacking on Go code, I'll incrementally commit my changes, and when I'm ready to tag it, I'll run:

$ go fmt
$ git commit -a -m"go fmt"
$ git tag 1.2.3

I do it this way, as the prior commit shows just specifically the changes I made, where when 'go fmt' is run it can adjust a lot of non-related code with formatting changes.

Unfortunately, this will cause problems for git-rebasetags. My ideas is to also use Author and AuthorDate as matching criteria as that shouldn't change during rebases.

$ git log --pretty=fuller

What do you think about this and possibly other seldom-to-change items from the commit message? I know Author* items can be changed in history, but for the most part it would add an extra level of matching criteria that should increase the success rate.

nachoparker commented 7 years ago

That's a very good idea!

We can match the date and even the author, I am pretty sure this will make it work almost perfectly, as long as they are kept during the rebase operation!

A lot of times, while hacking on Go code, I'll incrementally commit my changes, and when I'm ready to tag it, I'll run:

Yeah, a classic is update README.md

TerraTech commented 7 years ago

I forgot to ask, will you be taking on the development of this enhancement?

nachoparker commented 7 years ago

I am pretty busy with other projects right now, so maybe later