I would like to generate a simple, increasing version integer,
based on when a commit has changed a certain folder. And, I want
this version number to be valid across branches.
To illustrate, suppose the folder is named FOO, and it is on BRANCH1 and BRANCH2.
Let’s say version V is currently equal to 10.
1) make a commit that modifies FOO on BRANCH1: I would like V = 11
2) now make a commit that modifies FOO on BRANCH2: I would like V = 12
Any help would be greatly appreciated!
Jacko
Branches are mere pointers on a graph.
git describeremains the only “label” valid across repos.This question has an example where git describe is used to generate a “Vxxx”.
You also have
git name-revif you want a “label” relative to a branch (but not valid across repos).