Could snapshot links be named after git describe ?

John Keeping john at keeping.me.uk
Sun Oct 23 18:10:25 CEST 2016


On Mon, Oct 10, 2016 at 11:04:11AM +0200, Sylvain Rabot wrote:
> Currently the snapshots and resulted downloaded files are named like
> this <project>-<branch|sha1>.<zip|tar.gz|tar.bz2>
> 
> I was wondering if they could be named using the git describe format
> instead. I think it would make more sens and be prettier.
> 
> Naming the file after the branch does not make much sens according to
> me as it could be any commit of the said branch at any given time and
> the full sha1 is not really useful.
> 
> <project>-$(git describe --abbrev=6).<zip|tar.gz|tar.bz2> seems the
> best to me. I find it really useful to have the last tag name and the
> number of commits since.

It turns out that this already works, at least for the fetching side.
For example for current tip of CGit's master branch:

	https://git.zx2c4.com/cgit/snapshot/cgit-v1.0-41-gc330a2e.tar.xz

However, switching to describe format when generating the links doesn't
look particularly straightforward since the code Git uses to do so is
not in libgit.a which CGit links against, so we'd either have to push
some refactoring patches upstream or reimplement the functionality.

I'm not a heavy user of the snapshot links except from scripts which
tend to just use a tag or SHA-1 so I don't intend to work on this, but
personally I wouldn't object to patches that cleanly implement this as a
switchable config option.


More information about the CGit mailing list