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

Re: [PATCH v2 0/2] add a reflog_exists and delete_reflog abstraction

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
May 7, 2014, 11:56 UTC
Message-ID
<536A1F84.8020902@alum.mit.edu>
In-Reply-To
<1399416353-31817-1-git-send-email-sahlberg@google.com>
On 05/07/2014 12:45 AM, Ronnie Sahlberg wrote:
Show 28 quoted lines
> This is a series adds two new functions to try to hide the reflog
> implementation details from the callers in checkout.c and reflog.c.
> It adds new functions to test if a reflog exists and to delete it, thus
> allowing checkout.c to perform this if-test-then-delete operation without
> having to know the internal implementation of reflogs (i.e. that they are files
> that live under .git/logs)
> 
> Additionally we change checkout.c to use ref_exists instead of file_exists
> when checking for ref existence. This fixes a bug when checkout could delete
> a valid reflog file if the branch was a packed ref. The tests have been updated
> to test for this bug.
> 
> 
> Version 2:
>  - Typos and fixes suggested by mhagger.
>  - Break the checkout-deletes reflog bugfix out into a separate patch.
> 
> 
> Ronnie Sahlberg (2):
>   refs.c: add new functions reflog_exists and delete_reflog
>   checkout.c: use ref_exists instead of file_exist
> 
>  builtin/checkout.c |  8 ++------
>  builtin/reflog.c   |  2 +-
>  refs.c             | 21 +++++++++++++++------
>  refs.h             |  6 ++++++
>  t/t1410-reflog.sh  |  8 ++++++++
>  5 files changed, 32 insertions(+), 13 deletions(-)
+1 Looks good to me.  Thanks!
Michael
-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Ronnie SahlbergNext: Junio C Hamano
Message 4 of 5 in “add a reflog_exists and delete_reflog abstraction”
  1. 0/2 add a reflog_exists and delete_reflog abstractionRonnie Sahlberg, May 6, 2014
  2. 1/2 refs.c: add new functions reflog_exists and delete_reflogRonnie Sahlberg, May 6, 2014
  3. 2/2 checkout.c: use ref_exists instead of file_existRonnie Sahlberg, May 6, 2014
  4. Michael HaggertyMay 7, 2014
  5. Junio C HamanoMay 7, 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.