Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 042a54d251
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2e09c01232
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Sep 28, 2019

  1. name-rev: avoid cutoff timestamp underflow

    When 'git name-rev' is invoked with commit-ish parameters, it tries to
    save some work, and doesn't visit commits older than the committer
    date of the oldest given commit minus a one day worth of slop.  Since
    our 'timestamp_t' is an unsigned type, this leads to a timestamp
    underflow when the committer date of the oldest given commit is within
    a day of the UNIX epoch.  As a result the cutoff timestamp ends up
    far-far in the future, and 'git name-rev' doesn't visit any commits,
    and names each given commit as 'undefined'.
    
    Check whether subtracting the slop from the oldest committer date
    would lead to an underflow, and use no cutoff in that case.  We don't
    have a TIME_MIN constant, dddbad7 (timestamp_t: a new data type for
    timestamps, 2017-04-26) didn't add one, so do it now.
    
    Note that the type of the cutoff timestamp variable used to be signed
    before 5589e87 (name-rev: change a "long" variable to timestamp_t,
    2017-05-20).  The behavior was still the same even back then, but the
    underflow didn't happen when substracting the slop from the oldest
    committer date, but when comparing the signed cutoff timestamp with
    unsigned committer dates in name_rev().  IOW, this underflow bug is as
    old as 'git name-rev' itself.
    
    Helped-by: Johannes Sixt <[email protected]>
    Signed-off-by: SZEDER Gábor <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    szeder authored and gitster committed Sep 28, 2019
    Configuration menu
    Copy the full SHA
    2e09c01 View commit details
    Browse the repository at this point in the history
Loading