emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-repository-version on MS-Windows


From: Andreas Schwab
Subject: Re: emacs-repository-version on MS-Windows
Date: Sun, 16 Nov 2014 17:33:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> So is the following algorithm correct?
>
>   . visit the file .git/HEAD
>   . if the contents is a SHA1 checksum, we are done: return that SHA1
>   . otherwise:
>     . parse the contents of .git/HEAD that should have the form
>       "ref: refs/heads/BRANCH" where BRANCH is the name of the active
>       branch
>     . try visiting the file .git/refs/heads/BRANCH
>     . if the file exists, its contents should be the SHA1 checksum we
>       are looking for
>     . otherwise:
>       . visit the file .git/packed-refs, whose contents should be
>               lines of the form "SHA1 REF"
>       . find the line in that file whose REF part is "refs/heads/BRANCH"
>       . the SHA1 part of that line is the checksum we are looking for
>
> Does this cover all the possible arrangements of the repository and
> all the possible workflows?

.git can also be a gitdir file.

> Btw, I think the packed-refs part is unnecessary, since the active
> branch will never be packed -- is that right?

No, any ref can be packed.

> Question: Can .git/HEAD specify a branch in refs/remotes/?  If so,
> what do we do in the above algorithm? punt and return nil?

There is nothing wrong with that.  You should not assume any meaning in
the ref namespaces.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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