git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: [PATCH RFC] parse_object: pass on the original sha1, not the replaced one
Date: Tue, 3 Aug 2010 07:00:40 +0200	[thread overview]
Message-ID: <201008030700.40533.chriscool@tuxfamily.org> (raw)
In-Reply-To: <AANLkTin0eymuYFv_6hamDuan0TELogtCyW3Xwjm=pAwH@mail.gmail.com>

On Monday 02 August 2010 11:31:23 Nguyen Thai Ngoc Duy wrote:
> 2010/8/2 Christian Couder <chriscool@tuxfamily.org>:
> > 
> > I am not sure I understand what you are saying. Do you mean that git log
> > should show the original sha1 but the content of the replacement commit,
> > instead of both the sha1 and the content of the replacement commit?
> 
> "original sha1, but the content of replacement commit", yes. Isn't
> that the intention of git-replace?

I think it's better if the sha1 is replaced too. This way we keep the link 
between the sha1 and the content.

And it's easier for the user to realize that we gave him a replacement object 
if we use the replacement sha1 as the user can more easily see that the sha1 
changed.

> > I just tested your patch and indeed with it it seems to me that the
> > result shown by git log is not consistent, as for example the commit
> > message is the one of the replacement commit but the commit sha1 is the
> > one of the original commit.
> 
> The consistency is already there. Suppose I want to replace commit A
> with B. Depends on what function I call to fetch "A", I get different
> object->sha1. (the content is always from B though).
> 
> With parse_object(A), I get an object pointer whose sha1 is B.
> 
> With  lookup_commit(A), I get an object pointer whose sha1 is A.

Maybe there is a bug somewhere and you should get an object pointer whose sha1 
is B or maybe the content of the object that was inserted in the lookup table 
should have been the content from A and not from B. I will try to have a 
deeper look at that, but it would help if you could give an example of a 
command that triggers this behavior.

Best regards,
Christian.

  reply	other threads:[~2010-08-03  5:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 12:36 [PATCH RFC] parse_object: pass on the original sha1, not the replaced one Nguyễn Thái Ngọc Duy
2010-08-02  7:42 ` Christian Couder
2010-08-02  9:31   ` Nguyen Thai Ngoc Duy
2010-08-03  5:00     ` Christian Couder [this message]
2010-08-03  6:01       ` Nguyen Thai Ngoc Duy
2010-08-04 11:58         ` Christian Couder
2010-08-04 12:42           ` Nguyen Thai Ngoc Duy
2010-08-04 12:57             ` Christian Couder
2010-08-04 22:07               ` Nguyen Thai Ngoc Duy
2010-08-05 11:41                 ` Christian Couder
2010-08-07  4:03                   ` Nguyen Thai Ngoc Duy
2010-08-13  3:59                     ` Christian Couder
2010-08-13  9:02                       ` Nguyen Thai Ngoc Duy
2010-08-14  2:03                         ` Christian Couder

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008030700.40533.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).