guix-devel
[Top][All Lists]
Advanced

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

Re: On raw strings in <origin> commit field


From: zimoun
Subject: Re: On raw strings in <origin> commit field
Date: Tue, 04 Jan 2022 14:15:16 +0100

Hi Liliana,

On Tue, 04 Jan 2022 at 09:51, zimoun <zimon.toutoune@gmail.com> wrote:
> On Tue, 04 Jan 2022 at 06:23, Liliana Marie Prikler 
> <liliana.prikler@gmail.com> wrote:
>
>>> The content can be one file, some files, folders, etc.  or Git
>>> objects as Git commit object or Git tree object or whatever. 
>>> Therefore, Git commit hash only depends on the content itself, i.e.,
>>> Git commit object; as explained by the pointer provided earlier in
>>> the thread,
>>> 
>>>     <https://git-scm.com/book/en/v2/Git-Internals-Git-Objects>
>>
>> At some point in there (you can figure out yourself where), you are
>> mistakenly equating file hashes and commit hashes, which you make
>> comparison to other tools which only regard the files as content.  One
>> of them is immutable for all I know, the other is subject to very
>> observable changes.

Let pick one commit in the Git history, for instance:
e598e46913c661bc92df813d537eeb6be5a86471. 

--8<---------------cut here---------------start------------->8---
$ git --no-pager show e598e46913c661bc92df813d537eeb6be5a86471

commit e598e46913c661bc92df813d537eeb6be5a86471
Author: Tobias Geerinckx-Rice <me@tobias.gr>
Date:   Tue Oct 26 02:01:41 2021 +0200

    gnu: darkhttpd: Update to 1.13.
    
    * gnu/packages/web.scm (darkhttpd): Update to 1.13.
    [source]: Use GIT-FETCH and GIT-FILE-NAME.
    [arguments]: Don't explicitly return #t from phases.

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index dc5a9d61a8..2bd3c4ea13 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -5791,28 +5791,28 @@ (define-public surfraw
[...]
--8<---------------cut here---------------end--------------->8---

Let copy somewhere the content of this Git commit:

    $ mkdir -p /tmp/kikoo
    $ cp .git/objects/e5/98e46913c661bc92df813d537eeb6be5a86471 \
         /tmp/kikoo/content

Now, let run inside a container:

        $ cd /tmp/kikoo
        $ guix shell -C coreutils gzip
        [env]$ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" \
                  | cat - content | gzip -d | sha1sum

        gzip: stdin: unexpected end of file
        e598e46913c661bc92df813d537eeb6be5a86471  -

Explain me.  « Git commit hash only depends on the content itself, i.e.,
Git commit object », as I wrote.

Instead of taking a superior tone «(you can figure out yourself where)»,
I would prefer that you correctly read the messages I wrote.  Maybe,
that’s why my previous email is probably is bit harsh, sorry.


Specifically, the content of this Git commit is just:

--8<---------------cut here---------------start------------->8---
$ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - content | gzip -d

commit 662tree 44207c0d8c9e885b156bb98562221beb2ab8f7bf
parent b8fc7c23596b542b81306829b31cf255d908fa65
author Tobias Geerinckx-Rice <me@tobias.gr> 1635206501 +0200
committer Tobias Geerinckx-Rice <me@tobias.gr> 1635206568 +0200
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iIMEABYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYXdFqA0cbWVAdG9iaWFz
 LmdyAAoJEA2w/4hPVW15OoAA+gIzCyrlUEBUFdLp0CBFW1GxjVzYiSFMmk5aNDNu
 OngEAQDoisl2dQK7lLvIl/2xXDqoJ2CAoiqZ1DbGNyg3Yt/DCA==
 =RH+I
 -----END PGP SIGNATURE-----

gnu: darkhttpd: Update to 1.13.

* gnu/packages/web.scm (darkhttpd): Update to 1.13.
[source]: Use GIT-FETCH and GIT-FILE-NAME.
[arguments]: Don't explicitly return #t from phases.
--8<---------------cut here---------------end--------------->8---

The files and folders are in a Git tree object, referred in the Git
commit object by ’tree 44207c0d8c9e885b156bb98562221beb2ab8f7bf’.

I let you run this command from the Guix git repo:

    $ git cat-file -p 44207c0d8c9e885b156bb98562221beb2ab8f7bf


Please re-read all your answers and mines.  I hope you will see where
you were incorrect.


Cheers,
simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]