git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH RFC] parse_object: pass on the original sha1, not the replaced one

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 4, 2010, 12:42 UTC
Message-ID
<AANLkTimPQcZN-ASP+N+h9GaOSkgbnyNxiSktL+z-nBRu@mail.gmail.com>
In-Reply-To
<201008041358.13081.chriscool@tuxfamily.org>

On Wed, Aug 4, 2010 at 9:58 PM, Christian Couder <chriscool@tuxfamily.org> wrote:

Show 14 quoted lines
>> > 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.
>>
>> The following patch add "sha1" command. These commands give different sha1:
>>
>> git sha1 `git rev-parse HEAD` `git rev-parse HEAD^` A
>> git sha1 `git rev-parse HEAD` `git rev-parse HEAD^` B
>
> Yes, but that does not mean that the content of the object returned by
> lookup_commit(A) is not the content of A.
>
> Or do you have an example where the content of the object returned by
> lookup_commit(A) is not the content of A?

Both return the content of B. I modified my patch a bit to also show the content, ((struct commit*)obj)->buffer.

$ ./git cat-file -p HEAD tree 13109340ff2bd55bd16271bbad7a9232f9052923 parent 9a3028b987d73e4c85e8db9980720feba6a1b5c6 parent 2aedccd3d51ec922020f7c7e39df5d2c4d3af515 author Junio C Hamano <gitster@pobox.com> 1280274846 -0700 committer Junio C Hamano <gitster@pobox.com> 1280274905 -0700

Sync with 1.7.2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>

$ ./git cat-file -p HEAD^ tree 4ffcd88bed7a675e2d130a41203a7ebe026b6462 parent 9a9fb5d3c4c8601beb2d7b8e3b9283c6c3815a2d author Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1279925924 +0000 committer Junio C Hamano <gitster@pobox.com> 1280124888 -0700

tests: Ignore the Test::Harness .prove file

We document how to run prove with the --state option in t/README. This produces a .prove YAML file in the current directory. Change the t/ gitignore to ignore it, and clean it up on `make clean'.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

$ ./git sha1 `git rev-parse HEAD` `git rev-parse HEAD^` A old = ba9523ea809dc496a14f3644bdc1dd6f486983c0 new = 9a3028b987d73e4c85e8db9980720feba6a1b5c6 sha1 = 9a3028b987d73e4c85e8db9980720feba6a1b5c6 tree 4ffcd88bed7a675e2d130a41203a7ebe026b6462 parent 9a9fb5d3c4c8601beb2d7b8e3b9283c6c3815a2d author Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1279925924 +0000 committer Junio C Hamano <gitster@pobox.com> 1280124888 -0700

tests: Ignore the Test::Harness .prove file

We document how to run prove with the --state option in t/README. This produces a .prove YAML file in the current directory. Change the t/ gitignore to ignore it, and clean it up on `make clean'.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

$ ./git sha1 `git rev-parse HEAD` `git rev-parse HEAD^` B old = ba9523ea809dc496a14f3644bdc1dd6f486983c0 new = 9a3028b987d73e4c85e8db9980720feba6a1b5c6 sha1 = ba9523ea809dc496a14f3644bdc1dd6f486983c0 tree 4ffcd88bed7a675e2d130a41203a7ebe026b6462 parent 9a9fb5d3c4c8601beb2d7b8e3b9283c6c3815a2d author Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1279925924 +0000 committer Junio C Hamano <gitster@pobox.com> 1280124888 -0700

tests: Ignore the Test::Harness .prove file

We document how to run prove with the --state option in t/README. This produces a .prove YAML file in the current directory. Change the t/ gitignore to ignore it, and clean it up on `make clean'.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-- 
Duy
Previous: Christian CouderNext: Christian Couder
Message 7 of 14 in “parse_object: pass on the original sha1, not the replaced one”
  1. parse_object: pass on the original sha1, not the replaced oneNguyễn Thái Ngọc Duy, Jul 31, 2010
  2. Christian CouderAug 2, 2010
  3. Nguyen Thai Ngoc DuyAug 2, 2010
  4. Christian CouderAug 3, 2010
  5. Nguyen Thai Ngoc DuyAug 3, 2010
  6. Christian CouderAug 4, 2010
  7. Nguyen Thai Ngoc DuyAug 4, 2010
  8. Christian CouderAug 4, 2010
  9. Nguyen Thai Ngoc DuyAug 4, 2010
  10. Christian CouderAug 5, 2010
  11. Nguyen Thai Ngoc DuyAug 7, 2010
  12. Christian CouderAug 13, 2010
  13. Nguyen Thai Ngoc DuyAug 13, 2010
  14. Christian CouderAug 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.