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

Re: [PATCH 0/3] "git name-rev --weight"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2012, 15:54 UTC
Message-ID
<7vk3wgtlxb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<068F712399864538B59054590881E19C@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 6 quoted lines
> Is "--weight" the right term to use for the user (cli) interface?
> Wouldn't '--oldest' (or similar) be a better statement of what is
> desired (absent clock skew).
>
> While 'weight' may be a good internal technical description it didn't
> convey to me what was being sought (maybe -- deepest'?).

I agree with you that weight represents what it internally does. I however think that "oldest" is not quite good, as it still leaves the source of possible confusion. It has at least 3 (or 4, depending on how you count) possible meanings.

 - Is it the one with the oldest timestamp (and if so, do we use the
   committer date, or do we use the tagger date that may be much
   newer than the committer date)?
 - Is it the one with its longest path down to the root is the
   shortest (i.e. with smallest generation number)?
 - Is it the one with the smallest number of ancestor commits?

For the purpose of "oldest tag that contains this commit", I think the last one would give the most intuitive answer, but depending on your use case, you may want to enhance the command to support other definition of "oldest"; it does not feel quite right to have this particular definition (the last one) squat on the generic "--oldest" name.

We could punt to tautology and call it "--contains", meaning that is the logic used to implement "describe --contains" ;-) but that is not satisfactory, either.

I dunno.
Previous: Philip Oakley
Message 19 of 19 in “Funny 'git describe --contains' output”
  1. Greg KHAug 29, 2012
  2. Junio C HamanoAug 29, 2012
  3. Junio C HamanoAug 29, 2012
  4. Greg KHAug 29, 2012
  5. 0/3 "git name-rev --weight"Junio C Hamano, Aug 29, 2012
  6. 1/3 name-rev: lose unnecessary typedefJunio C Hamano, Aug 29, 2012
  7. 2/3 name_rev: clarify when a new tip-name is assigned to a commitJunio C Hamano, Aug 29, 2012
  8. 3/3 name-rev: --weight option (WIP)Junio C Hamano, Aug 29, 2012
  9. Junio C HamanoAug 29, 2012
  10. Jeff KingAug 30, 2012
  11. Junio C HamanoAug 30, 2012
  12. Jeff KingAug 30, 2012
  13. Junio C HamanoAug 30, 2012
  14. Junio C HamanoAug 30, 2012
  15. Junio C HamanoAug 30, 2012
  16. Jeff KingAug 30, 2012
  17. Junio C HamanoAug 30, 2012
  18. Philip OakleyAug 30, 2012
  19. Junio C HamanoAug 30, 2012

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.