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

Re: [PATCH] add a reflog_exists and delete_reflog abstraction

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2014, 19:15 UTC
Message-ID
<xmqq1tw6g1mp.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1399330677-17930-1-git-send-email-sahlberg@google.com>
Ronnie Sahlberg <sahlberg@google.com> writes:
> It currently has a hard assumption that the loose ref file must exist at this
> stage or else it would end up deleting the reflog which is true today, as far
> as I can tell, but would break if git would change such that we could have
> a branch checked out without having a loose ref file for that branch.
Hmmmm.  Do you mean this sequence will break?
        : gitster x; git init lo
        Initialized empty Git repository in /var/tmp/x/lo/.git/
        : gitster x; cd lo
        : gitster lo/master; git commit --allow-empty -m initial
        [master (root-commit) db2b430] initial
        : gitster lo/master; git branch next
Now we have two branches, master and next, and we are on master.
        : gitster lo/master; git pack-refs --all
        : gitster lo/master; ls .git/refs/heads
        ./  ../
        : gitster lo/master; cat .git/packed-refs
        # pack-refs with: peeled fully-peeled 
        db2b43072749258d1e3c119c9570349d77c26b3a refs/heads/master
        db2b43072749258d1e3c119c9570349d77c26b3a refs/heads/next
And loose refs are fully packed.
        : gitster lo/master; git checkout next
        Switched to branch 'next'
        : gitster lo/next; ls .git/refs/heads
        ./  ../
Previous: Ronnie SahlbergNext: Ronnie Sahlberg
Message 7 of 8 in “add a reflog_exists and delete_reflog abstraction”
  1. add a reflog_exists and delete_reflog abstractionRonnie Sahlberg, May 5, 2014
  2. refs.c: add new functions reflog_exists and delete_reflogRonnie Sahlberg, May 5, 2014
  3. Michael HaggertyMay 6, 2014
  4. Ronnie SahlbergMay 6, 2014
  5. Michael HaggertyMay 6, 2014
  6. Ronnie SahlbergMay 7, 2014
  7. Junio C HamanoMay 6, 2014
  8. Ronnie SahlbergMay 6, 2014

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.