Reputation: 92149
I looked at other answers on SO and identified that following command works, but does not honors the tag name in query
git log -p myReleaseTag ProductCatalog.java
This gives me all the changes in patch
since the file was ever created.
How do I tell git
to start from my tag myReleaseTag
?
Upvotes: 0
Views: 58
Reputation: 45809
As written, you're telling log
to show all changes reachable from myReleaseTag
(where "reachable from" means, more or less, "in the history of").
You could instead say
git log -p myReleaseTag..HEAD ProductCatalog.java
(or, slightly better practice:
git log -p myReleaseTag..HEAD -- ProductCatalog.java
as this will occasionally eliminate ambiguity in the command)
That would mean "all changes reachable from HEAD but not reachable from myReleaseTag". If you want to include the changes from the commit market by myReleaseTag
, then you could say
git log -p myReleaseTag^..HEAD -- ProductCatalog.java
(though that's only 100% straightforward if myReleaseTag
isn't marking a merge).
More generally, the argument that's controlling what to show is a revision range; there are several options for notation to specify such a range.
https://git-scm.com/book/en/v2/Git-Tools-Revision-Selection
UPDATE - One more example
Another way to interpret what you asked would be if you want every change that isn't included in the release, regardless of what branch(es) can reach that change. Then you could use
git log -p --all ^myReleaseTag -- ProductCatalog.java
and a change will be shown as long as it isn't present as of the release tag, and is reachable from some ref (tag, branch, ...)
Upvotes: 1