From: Michael Haggerty <mhagger@alum.mit.edu>
To: Christian Couder <chriscool@tuxfamily.org>,
Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [RFC/PATCH] replace: add --graft option
Date: Mon, 19 May 2014 11:42:07 +0200 [thread overview]
Message-ID: <5379D1EF.8040203@alum.mit.edu> (raw)
In-Reply-To: <20140518182939.5260.91202.chriscool@tuxfamily.org>
On 05/18/2014 08:29 PM, Christian Couder wrote:
> The usage string for this option is:
>
> git replace [-f] --graft <commit> [<parent>...]
>
> First we create a new commit that is the same as <commit>
> except that its parents are [<parents>...]
>
> Then we create a replace ref that replace <commit> with
> the commit we just created.
>
> With this new option, it should be straightforward to
> convert grafts to replace refs, with something like:
>
> cat .git/info/grafts | while read line
> do git replace --graft $line; done
I love the functionality; I think it's a great step towards making
grafts obsolete.
I haven't worked with Git's object reading/writing code much, but it
surprised me that you are editing the commit object basically as a
string, using hard-coded length constants and stuff. It seems
error-prone, and we already have a commit parser.
Would it be possible to program this at a higher layer of abstraction
based on the commit object produced by the existing commit parser?
E.g., edit the object it produces, and write the result? Or create a
new commit object out of the parsed commit object and write that?
It's great that you're working on this!
Michael
--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
next prev parent reply other threads:[~2014-05-19 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 18:29 [RFC/PATCH] replace: add --graft option Christian Couder
2014-05-19 9:42 ` Michael Haggerty [this message]
2014-05-19 11:19 ` Jeff King
2014-05-19 17:25 ` Junio C Hamano
2014-05-19 17:35 ` Jeff King
2014-05-19 18:34 ` Junio C Hamano
2014-05-23 6:39 ` Christian Couder
2014-05-19 11:21 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5379D1EF.8040203@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).