From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Jonathan Tan <jonathantanmy@google.com>,
git <git@vger.kernel.org>, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>,
Derrick Stolee <stolee@gmail.com>
Subject: Re: Regression in: [PATCH on sb/more-repo-in-api] revision: use commit graph in get_reference()
Date: Fri, 25 Jan 2019 23:14:14 +0100 [thread overview]
Message-ID: <20190125221414.GG6702@szeder.dev> (raw)
In-Reply-To: <CAGZ79kZRnuTU3ukP1UdBUZD1x+nubYSwLxYgJse1mcj8JUOa2g@mail.gmail.com>
On Fri, Jan 25, 2019 at 11:56:38AM -0800, Stefan Beller wrote:
> > Have fun! :)
>
> $ git gc
> ...
> Computing commit graph generation numbers: 100% (164264/164264), done.
> $ ./git version
> git version 2.20.1.775.g2313a6b87fe.dirty
> # pu + one commit addressing
> # https://public-inbox.org/git/CAGZ79kaUg3NTRPRi5mLk6ag87iDB_Ltq_kEiLwZ2HGZ+-Vsd8w@mail.gmail.com/
>
> $ ./git -c core.commitGraph=false describe --dirty --all
> remotes/gitgitgadget/pu-1-g03745a36e6
> $ ./git -c core.commitGraph=true describe --dirty --all
> remotes/gitgitgadget/pu-1-g03745a36e6
> $ ./git -c core.commitGraph=true describe --dirty
> v2.20.1-776-g03745a36e6
> $ ./git -c core.commitGraph=false describe --dirty
> v2.20.1-776-g03745a36e6
>
> it looks like it is working correctly here?
> Or did I miss some hint as in how to setup the reproduction properly?
How many refs are pointing to the commits you tried to describe? In
the git repo, with an all-encompassing commit-graph it seems to be
important that more than one refs point there. I could reproduce the
issue in a fresh git.git clone with Git built from commit 2313a6b87fe:
$ git clone https://github.com/git/git
Cloning into 'git'...
<...>
$ git commit-graph write --reachable
Computing commit graph generation numbers: 100% (56722/56722), done.
# 'HOME=.' makes sure that this command doesn't read my global
# gitconfig.
$ HOME=. ~/src/git/git describe --all --dirty
heads/master-dirty
$ git checkout origin/pu
HEAD is now at cb3b9e7ee3 Merge branch 'jh/trace2' into pu
$ HOME=. ~/src/git/git -c core.commitGraph=true describe --all --dirty
remotes/origin/pu
$ git branch a-second-ref-pointing-at-pu buzz ~/src/tmp/git
$ HOME=. ~/src/git/git -c core.commitGraph=true describe --all --dirty
heads/a-second-ref-pointing-at-pu-dirty
I could also reproduce it in other repositories lying around here, but
could not manage to reproduce it in a minimal repository.
The smallest I could get is the test script below, where the last test
fails, i.e. the clean worktree is described as '-dirty', when the
to-be-described HEAD is not in the commit-graph. I suspect this is
the same issue, because it bisects down to this same commit.
--- >8 ---
Subject: [PATCH] test
---
t/t9999-test.sh | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
create mode 100755 t/t9999-test.sh
diff --git a/t/t9999-test.sh b/t/t9999-test.sh
new file mode 100755
index 0000000000..cd1286e157
--- /dev/null
+++ b/t/t9999-test.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+test_description='test'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_commit one &&
+ test_commit two &&
+ # Two refs point there.
+ git for-each-ref --points-at=two &&
+ git config core.commitGraph true
+'
+
+test_expect_success 'full commit-graph' '
+ git commit-graph write --reachable &&
+ verbose test "$(git describe --all --dirty)" = tags/two
+'
+
+test_expect_success 'partial commit-graph, described HEAD is not in C-G' '
+ git rev-parse one | git commit-graph write --stdin-commits &&
+ git status &&
+ verbose test "$(git describe --all --dirty)" = tags/two
+'
+
+test_done
--
2.20.1.642.gc55a771460
next prev parent reply other threads:[~2019-01-25 22:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 22:42 [PATCH on sb/more-repo-in-api] revision: use commit graph in get_reference() Jonathan Tan
2018-12-04 23:12 ` Stefan Beller
2018-12-06 23:36 ` Jonathan Tan
2018-12-07 13:49 ` Derrick Stolee
2018-12-05 4:54 ` Jeff King
2018-12-06 23:54 ` Jonathan Tan
2018-12-07 8:53 ` Jeff King
2018-12-05 23:15 ` Junio C Hamano
2018-12-07 21:50 ` [PATCH on master v2] " Jonathan Tan
2018-12-09 0:51 ` Junio C Hamano
2018-12-09 1:49 ` Junio C Hamano
2018-12-11 10:54 ` Jeff King
2018-12-12 19:58 ` Jonathan Tan
2018-12-13 1:27 ` Jeff King
2018-12-13 16:20 ` Derrick Stolee
2018-12-13 18:54 ` [PATCH v3] " Jonathan Tan
2018-12-14 3:20 ` Junio C Hamano
2018-12-14 8:45 ` Jeff King
2019-01-25 15:33 ` Regression in: [PATCH on sb/more-repo-in-api] " SZEDER Gábor
2019-01-25 19:56 ` Stefan Beller
2019-01-25 22:01 ` Jonathan Tan
2019-01-25 22:14 ` SZEDER Gábor [this message]
2019-01-25 22:21 ` SZEDER Gábor
2019-01-27 13:08 ` [PATCH] object_as_type: initialize commit-graph-related fields of 'struct commit' SZEDER Gábor
2019-01-27 13:28 ` SZEDER Gábor
2019-01-27 18:40 ` Derrick Stolee
2019-01-28 16:15 ` Jeff King
2019-01-28 16:57 ` Jonathan Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190125221414.GG6702@szeder.dev \
--to=szeder.dev@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@google.com \
--cc=peff@peff.net \
--cc=sbeller@google.com \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).