Re: [BUG] Cannot push some grafted branches
- From
Thomas Rast <trast@inf.ethz.ch>
- Date
- Dec 18, 2012, 14:31 UTC
- Message-ID
- <87txrjsa8o.fsf@pctrast.inf.ethz.ch>
- In-Reply-To
- <20121218144157.00ccd915@chalon.bertin.fr>
Yann Dirson <dirson@bertin.fr> writes:
Show 19 quoted lines
>> +EXAMPLE >> +------- >> + >> +Replacements (and before them, grafts) are often used to replace the >> +parent list of a commit. Since commits are stored in a human-readable >> +format, you can in fact change any property using the following >> +recipe: >> + >> +------------------------------------------------ >> +$ git cat-file commit original_commit >tmp >> +$ vi tmp >> +------------------------------------------------ >> +In the editor, adjust the commit as needed. For example, you can edit >> +the parent lists by adding/removing lines starting with "parent". >> +When done, replace the original commit with the edited one: >> +------------------------------------------------ >> +$ git replace original_commit $(git hash-object -w tmp) > > You probably meant "-t commit" - a sign that it's not so trivial to forge ?
Mostly a sign that despite my testing efforts, I still fail at cut&paste...
But yes, it absolutely needs -t commit. Otherwise the commit would be replaced by a blob, and confusion ensues.
--
Thomas Rast
trast@{inf,student}.ethz.ch