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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> |
Debian-related: <dirson@xxxxxxxxxx> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]