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

[BUG] "cg-object-id -p" ignore grafts, breaks cg-admin-rewritehist

From
Yann Dirson <ydirson@altern.org>
Date
May 9, 2006, 22:25 UTC
Message-ID
<20060509222519.GF27397@nowhere.earth>

Currently (cogito 0.17.2), using "cg-object-id -p" to lookup a commit's parents fetches information directly from the commit object through "git-cat-file commit". This causes all its callers to ignore any grafts, and probably causes various problems. The one I stumbled upon is an inconstency in the data seen by cg-admin-rewritehist, when a graft is used to replace the single parent of a commit with another single parent - tentative recovery of a tarball import done on a wrong branch, in the hope that cg-admin-rewritehist would allow to fix the history as defined by the graft.

In that case, after identifying the commits to rewrite through legal means, rewritehist attempts to lookup the parents for each of those original commits and map them to already-rewritten ones, but cg-object-id returns the pre-graft parent, which was not to be rewritten, and the tool fails (miserably with an invalid rewritten branch, as the exception is not caught).

A patch follows (depending on an updated "set -e" patch for rewritehist) to have rewritehist at least abort in error when it can identify such an inconsistency.

What should cg-object-id use to lookup parent information in a sane way that does not ignore grafts ?

-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>
Message 1 of 1 in “[BUG] "cg-object-id -p" ignore grafts, breaks cg-admin-rewritehist”
  1. Yann DirsonMay 9, 2006

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.