{"thread":{"id":"4112","subject":"[BUG] \"cg-object-id -p\" ignore grafts, breaks cg-admin-rewritehist","startedAt":"2006-05-09T22:25:19Z","lastAt":"2006-05-09T22:25:19Z","messageCount":1,"participants":["Yann Dirson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"19800","messageId":"20060509222519.GF27397@nowhere.earth","threadId":"4112","inReplyTo":null,"subject":"[BUG] \"cg-object-id -p\" ignore grafts, breaks cg-admin-rewritehist","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-05-09T22:25:19Z","receivedAt":"2006-05-09T22:25:19Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nCurrently (cogito 0.17.2), using \"cg-object-id -p\" to lookup a\ncommit's parents fetches information directly from the commit object\nthrough \"git-cat-file commit\".  This causes all its callers to ignore\nany grafts, and probably causes various problems.  The one I stumbled\nupon is an inconstency in the data seen by cg-admin-rewritehist, when\na graft is used to replace the single parent of a commit with another\nsingle parent - tentative recovery of a tarball import done on a wrong\nbranch, in the hope that cg-admin-rewritehist would allow to fix the\nhistory as defined by the graft.\n\nIn that case, after identifying the commits to rewrite through legal\nmeans, rewritehist attempts to lookup the parents for each of those\noriginal commits and map them to already-rewritten ones, but\ncg-object-id returns the pre-graft parent, which was not to be\nrewritten, and the tool fails (miserably with an invalid rewritten\nbranch, as the exception is not caught).\n\nA patch follows (depending on an updated \"set -e\" patch for\nrewritehist) to have rewritehist at least abort in error when it can\nidentify such an inconsistency.\n\nWhat should cg-object-id use to lookup parent information in a sane\nway that does not ignore grafts ?\n\n-- \nYann Dirson    <ydirson@altern.org> |\nDebian-related: <dirson@debian.org> |   Support Debian GNU/Linux:\n                                    |  Freedom, Power, Stability, Gratis\n     http://ydirson.free.fr/        | Check <http://www.debian.org/>\n"}]}