-
Notifications
You must be signed in to change notification settings - Fork 3
Description
The tar_git
script does not obey the branch
parameter, if there is no valid tag (according to tar_git
's processing rules) or if a commit ID (short-hash) was provided, or if a branch
parameter is set and either no revision
is set or in this Git branch commits exist newer than the tag referenced by the revision
parameter: Then tar_git
looks for the "closest" tag in the function set_versha
which fulfils its tag processing rules, but misses to filter for the branch provided by the branch
parameter (i.e., it searches in all branches).
Still, it uses the value of the branch
parameter, or if none is provided, the branch name in which the "closest" tag was found to construct a new version string, which comprises: The processed name of the "closest" tag, a +
, the branch name, a .
, a date-time string (YYYYMMDDhhmmss
), the number of commits since the "closest" tag in the branch it resides enclosed in dots .<n>.
, a g
if newer commits exist in the branch referenced by branch
than the tag referenced by revision
, and the short-hash of the latest commit, resulting in, e.g., 0.5.2+main.20230129011931.6.g584263a
with 0.5.2-3
as "closest" tag found. Note that if the "closest" tag determined does not originate from the branch provided by the branch
parameter, still this parameter is inserted in the constructed string, despite using a Git checkout from another branch.
Hence this issue actually describes two different, but related bugs:
- The
tar_git
script does not obey thebranch
parameter, if there is no valid tag (according totar_git
's processing rules) or if a commit ID (short-hash) was provided, or if abranch
parameter is set and either norevision
is set or in this Git branch commits exist newer than the tag referenced by therevision
parameter. - If the
tar_git
script decides to check out a different branch than the one provided by thebranch
parameter, it still inserts the provided branch name into the constructed version name, instead of the name of the branch actually used. It does already do the right thing, if nobranch
parameter is provided: Using the branch name from which the source code is checked out.