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

Re: [PATCH v2 2/6] cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refs

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2015, 21:11 UTC
Message-ID
<xmqqsi9fwl0i.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1435265110-6414-2-git-send-email-dturner@twopensource.com>
David Turner <dturner@twopensource.com> writes:
Show 6 quoted lines
> Instead of directly writing to and reading from files in
> $GIT_DIR, use ref API to interact with CHERRY_PICK_HEAD
> and REVERT_HEAD.
>
> Signed-off-by: David Turner <dturner@twopensource.com>
> ---

I may have said this already in the last round, but I cannot shake off the feeling that this patch is doing two completely unrelated things at once.

The change to refs.c that introduced the should_autocreate_reflog() helper (which is a good idea even without any other changes in this patch) and then using that to commit_ref_update() does not have anything to do with CHERRY_PICK_HEAD/REVERT_HEAD, does it?

 * commit_ref_update() gained a new "flags" parameter, but it does
   not seem to be used at all.  Why?
 * Why is it a good idea to move the "does the log exist or should
   we auto-create?" check from log_ref_setup() to
   commit_ref_update()?

These are not just unexplained, but does not have anything to do with using ref API to write and read CHERRY_PICK_HEAD/REVERT_HEAD.

They _might_ be a prerequisite, but it is not clear why. I suspect that you do not have to touch refs.c at all for the purpose of the "theme" of the patch explained by the "Subject" line.

Previous: David TurnerNext: David Turner
Message 3 of 14 in “refs.c: add err arguments to reflog functions”
  1. 1/6 refs.c: add err arguments to reflog functionsDavid Turner, Jun 25, 2015
  2. 2/6 cherry-pick: treat CHERRY_PICK_HEAD and REVERT_HEAD as refsDavid Turner, Jun 25, 2015
  3. Junio C HamanoJun 25, 2015
  4. David TurnerJun 25, 2015
  5. 3/6 bisect: use refs infrastructure for BISECT_STARTDavid Turner, Jun 25, 2015
  6. Junio C HamanoJun 25, 2015
  7. David TurnerJun 25, 2015
  8. David TurnerJun 26, 2015
  9. 4/6 refs: add safe_create_reflog functionDavid Turner, Jun 25, 2015
  10. Junio C HamanoJun 25, 2015
  11. 5/6 git-reflog: add create and exists functionsDavid Turner, Jun 25, 2015
  12. Junio C HamanoJun 25, 2015
  13. David TurnerJun 25, 2015
  14. 6/6 git-stash: use git-reflog instead of creating filesDavid Turner, Jun 25, 2015

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.