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

Re: [PATCH 7/6 (v4)] support for commit grafts, slight change to general mechanism

From
Thomas Rast <trast@student.ethz.ch>
Date
Oct 21, 2009, 13:44 UTC
Message-ID
<200910211544.08776.trast@student.ethz.ch>
In-Reply-To
<200910211115.25017.trast@student.ethz.ch>
Thomas Rast wrote:
Show 12 quoted lines
> Nick Edelen wrote:
> > Adds support for graft commits in rev-cache (w/ test), and slightly alters
> > graft mechanism.  Before, parse_commit() checked the graft list on every
> > commit.  Now register_commit_graft() preemptively loads graft commits into
> > memory, and sets a new 'graft' flag in the object.  This allows awareness of
> > the commits' medical history without searching a (normally private) array upon
> > each commit.
> 
> I felt adventurous and merged the topic into my local build, but I get
> "error: duplicate graft data ..." in repositories with only a single
> line in .git/info/grafts, which bisects to this commit (1c0a666 in
> today's pu).

Here's the complaint in squashable form if you want to keep it as a testcase:

diff --git i/t/t6001-rev-list-graft.sh w/t/t6001-rev-list-graft.sh
index b2131cd..49ba37b 100755
--- i/t/t6001-rev-list-graft.sh
+++ w/t/t6001-rev-list-graft.sh
@@ -110,4 +110,18 @@ do
 	"
 
 done
+
+duplicate_error="error: duplicate graft"
+
+test_expect_success 'duplicates: no false positives' '
+	echo $B0 $A2 > .git/info/grafts &&
+	! git rev-list -1 HEAD 2>&1 | grep -q "$duplicate_error"
+'
+
+test_expect_success 'duplicates: no false negatives' '
+	echo $B0 $A2 > .git/info/grafts &&
+	echo $B0 $A1 >> .git/info/grafts &&
+	git rev-list -1 HEAD 2>&1 | grep "$duplicate_error"
+'
+
 test_done
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Thomas RastNext: Nick Edelen
Message 7 of 8 in “support for commit grafts, slight change to general mechanism”
  1. 7/6 support for commit grafts, slight change to general mechanismNick Edelen, Sep 7, 2009
  2. Nick EdelenSep 27, 2009
  3. Shawn O. PearceSep 29, 2009
  4. Chris JohnsenSep 30, 2009
  5. Nick EdelenOct 19, 2009
  6. Thomas RastOct 21, 2009
  7. Thomas RastOct 21, 2009
  8. Nick EdelenOct 27, 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.