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: Andy Moreton
Subject: Re: emacs-repository-version on MS-Windows
Date: Sun, 16 Nov 2014 23:41:12 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

On Sun 16 Nov 2014, Eli Zaretskii wrote:

>> From: Andreas Schwab <address@hidden>
>> Cc: Eli Zaretskii <address@hidden>,  address@hidden
>> Date: Sat, 15 Nov 2014 23:42:46 +0100
>> 
>> > The bzr version of this intentionally avoided calling external executables.
>> > (Apparently not possible with git.)
>> 
>> You can do that with git as well, the repository structure is fully
>> documented (gitrepository-layout(5)).  Of course, you have to be
>> prepared to update the procedure in case of future extensions.
>
> 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?

The descripriton of .git/HEAD in gitrepository-layout(5) suggests that
it can also be a symlink rather than a git symref.

    AndyM




reply via email to

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