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

Re: git describe --contains doesn't work properly for a commit

From
Mike Hommey <mh@glandium.org>
Date
Mar 4, 2015, 22:05 UTC
Message-ID
<20150304220553.GA24801@glandium.org>
In-Reply-To
<xmqq7fuw8pgq.fsf@gitster.dls.corp.google.com>
On Wed, Mar 04, 2015 at 12:41:57PM -0800, Junio C Hamano wrote:
Show 28 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > On Wed, Mar 04, 2015 at 04:06:17PM +0100, Michael J Gruber wrote:
> >
> >> Complexity: Was that due to replace refs? Other than that, it seemed to
> >> be simple: max(parent generation numbers)+1.
> >
> > Calculating them is simple. Caching and storage is the bigger question.
> 
> Yes, also having to handle the ones whose generation numbers haven't
> been computed yet adds to the complexity.
> 
> This one, and $gmane/264101, are a few instances of this known issue
> raised here recently.  I have been wondering if we can do something
> along the following (these are not alternatives) as a cheaper
> workaround:
> 
>  (1) Introduce '--skewed-timestamps[=(allow|warn|reject)' to all
>      commands that create new commit objects.  If the committer
>      timestamp being used is older than any of the parent commits,
>      "warn" or "reject" depending on the setting.
> 
>      Make 'reject' the default for commands that are purely local
>      (i.e. recording your own progress by cherry-picking,
>      committing, rebasing, reverting, etc.) and 'warn' the default
>      for commands that merge other peoples' history that you may
>      lack the power to rewind and correct (e.g. 'pull' and 'merge'
>      from remote tracking refs).

Please note that a common cause (for me, at least) of skewed timestamps is importing from a foreign VCS.

Mike
Previous: Junio C HamanoNext: Jeff King
Message 7 of 9 in “git describe --contains doesn't work properly for a commit”
  1. Michal HockoFeb 26, 2015
  2. Michal HockoFeb 26, 2015
  3. Jeff KingMar 4, 2015
  4. Michael J GruberMar 4, 2015
  5. Jeff KingMar 4, 2015
  6. Junio C HamanoMar 4, 2015
  7. Mike HommeyMar 4, 2015
  8. Jeff KingMar 5, 2015
  9. Junio C HamanoMar 5, 2015

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.