all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: emacs-repository-version on MS-Windows
Date: Sun, 16 Nov 2014 17:33:09 +0100	[thread overview]
Message-ID: <87389jxfzu.fsf@igel.home> (raw)
In-Reply-To: <834mtzdtfr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 16 Nov 2014 18:03:04 +0200")

Eli Zaretskii <eliz@gnu.org> 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, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



  parent reply	other threads:[~2014-11-16 16:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14  9:32 emacs-repository-version on MS-Windows Eli Zaretskii
2014-11-14  9:40 ` Eli Zaretskii
2014-11-14  9:48 ` Chris Zheng
2014-11-14 10:13   ` Eli Zaretskii
2014-11-14 10:53     ` Chris Zheng
2014-11-14 14:13       ` Eli Zaretskii
2014-11-15 11:27         ` Fabrice Popineau
2014-11-15 11:39           ` Eli Zaretskii
2014-11-15 11:58             ` Fabrice Popineau
2014-11-15 12:57               ` Fabrice Popineau
2014-11-15 13:01               ` Eli Zaretskii
2014-11-14  9:57 ` martin rudalics
2014-11-14 10:14   ` Eli Zaretskii
2014-11-14 10:57   ` Dani Moncayo
2014-11-14 14:15     ` Eli Zaretskii
2014-11-15 20:20       ` Eli Zaretskii
2014-11-15 21:44         ` Glenn Morris
2014-11-15 22:42           ` Andreas Schwab
2014-11-16 16:03             ` Eli Zaretskii
2014-11-16 16:27               ` David Kastrup
2014-11-16 17:56                 ` Eli Zaretskii
2014-11-16 18:26                   ` David Kastrup
2014-11-16 16:33               ` Andreas Schwab [this message]
2014-11-16 18:00                 ` Eli Zaretskii
2014-11-16 18:15                 ` Eli Zaretskii
2014-11-16 16:47               ` Achim Gratz
2014-11-16 18:05                 ` Eli Zaretskii
2014-11-16 23:41               ` Andy Moreton
2014-11-17  3:45                 ` Eli Zaretskii
2014-11-16 19:30             ` Glenn Morris
2014-11-16  3:40           ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=87389jxfzu.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.