gitian-builder icon indicating copy to clipboard operation
gitian-builder copied to clipboard

Use ref name as tag name instead of the constant "tobuild"

Open devrandom opened this issue 4 years ago • 4 comments

@dongcarl @abitmore - here's yet another improvement to #238, naming the local tag the same as the ref that was requested on the command line. This play better with git describe --tags.

Review / test would be welcome.

Fixes #243.

devrandom avatar Jan 25 '21 01:01 devrandom

Thanks. I'll test and report back.

abitmore avatar Jan 25 '21 10:01 abitmore

Unfortunately this does not work when checking out a commit or a branch, since git describe --tags may return different result after added the new tag.

Ideally we should avoid adding tags. I'll take a look to see how to fix it.

GIT-DESCRIBE(1)                                                             Git Manual                                                             GIT-DESCRIBE(1)

NAME
       git-describe - Describe a commit using the most recent tag reachable from it

SYNOPSIS
       git describe [--all] [--tags] [--contains] [--abbrev=<n>] [<commit-ish>...]
       git describe [--all] [--tags] [--contains] [--abbrev=<n>] --dirty[=<mark>]

DESCRIPTION
       The command finds the most recent tag that is reachable from a commit. 
If the tag points to the commit, then only the tag is shown. Otherwise, it suffixes
       the tag name with the number of additional commits on top of the tagged 
object and the abbreviated object name of the most recent commit.

       By default (without --all or --tags) git describe only shows annotated tags. 
For more information about creating annotated tags see the -a and -s options
       to git-tag(1).

...

       --tags
           Instead of using only the annotated tags, use any tag found in refs/tags 
namespace. This option enables matching a lightweight (non-annotated) tag.

...

abitmore avatar Jan 25 '21 10:01 abitmore

It turns out that

  • by fetching only the target commit/tag/branch (aka #238) gitian-builder saves bandwidth and etc, although it is sufficient for the build step itself, but no additional info is fetched which might be useful or needed for next steps for building;
  • by fetching all heads and tags it makes more info available, with a trade-off that more data gets transferred.

Apparently we can't have both. Perhaps a better approach is to define a new option, e.g. --fetch-all, so that everyone would be happier?

abitmore avatar Jan 25 '21 11:01 abitmore

See https://github.com/devrandom/gitian-builder/pull/245.

abitmore avatar Jan 25 '21 13:01 abitmore