git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH v4 2/2] gitweb: append short hash ids to snapshot files

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 13, 2009, 05:57 UTC
Message-ID
<7vr5ub1j5v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4AAC85AC.9080004@mailservices.uwaterloo.ca>
Mark Rada <marada@uwaterloo.ca> writes:
Show 5 quoted lines
> This was a manifestation of a suggestion from Jakub:
>
>> Second, I'd rather have better names for snapshots than using full SHA-1.
>> For snapshot of 'v1.5.0' of repository 'repo.git' I'd prefer for snapshot
>> to be named 'repo-v1.5.0', and for snapshot of 'next' branch of the same

I think I've already said "Don't use $full_hash but if the user gave you descriptive e.g. v1.5.0 in $hash just use it", which I think matches what Jakub said above.

>> project to be named for example 'repo-next-20090909', or perhaps
>> 'repo-next-2009-09-10T09:16:18' or 'repo-next-20090909-g5f6b0ff',
>> or 'repo-v1.6.5-rc0-164-g5f6b0ff'.

I do not particularly care about these, except that if the user asked for 'next', that string should be in the name somewhere, so the last one is unnacceptable to me. I'd rather vote for naming it just 'repo-next', as if I were writing a robot that goes once-a-day to next and download, I would likely to be doing it like this:

	D=`date +'%Y-%m-%d'` && mkdir "$D" && cd "$D" || exit
        wget ...snapshot-url-for-next-branch...
	wget ...snapshot-url-for-some-other-branch...
	wget ...snapshot-url-for-even-some-other-repository...
	...

and I do not want any frills other than what I _asked_ gitweb to give me, which is "this repository, this branch".

But that is just my personal preference. Treat it as no heavier than a feature request from a random list participant. It does not carry any more weight than that merely because it comes from me.

> For me, there are two fates that snapshots will end up with: being deleted
> as soon as I have unrolled the contents, or long term archiving. For the
> latter case, it is nice to have an idea of when it came from, though I
> guess I should have appended a date in that case... ¯\(°_o)/¯
What date do you mean?  The commit date?  Or download date?

As long as it is clear which revision the snapshot came from, I do not think anything fancier is necessary.

Besides, don't the paths in the archive have the timestamp of the commit object?

If you are talking about download date for archival use, I think the timestamp of the archive file itself is sufficient, and the person who is downloading can (re)name the result in whatever way he wants.

Previous: Mark Rada
Message 4 of 4 in “gitweb: append short hash ids to snapshot files”
  1. 2/2 gitweb: append short hash ids to snapshot filesMark Rada, Sep 12, 2009
  2. Junio C HamanoSep 13, 2009
  3. Mark RadaSep 13, 2009
  4. Junio C HamanoSep 13, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.