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

Re: [PATCH 1/2] Teach git-reset to let others override its reflog entry.

From
Junio C Hamano <junkio@cox.net>
Date
Dec 28, 2006, 06:13 UTC
Message-ID
<7vslf0zgwp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061228014336.GA16790@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> The new --reflog-action for git-reset behaves like the same option
> to git-merge; it can be used by the caller to override the message
> entry in the reflog and is intended to be used only when git-reset
> is acting as plumbing, not porcelain.
Honestly, I hate these --reflog-action options everywhere.

I wonder if something like this would be easier to manage in the longer run:

 * In git-sh-setup.sh, have this shell function.
	set_reflog_action () {
		if test -z "${GIT_REFLOG_ACTION+set}"
                then
                	GIT_REFLOG_ACTION="$*"
                        export GIT_REFLOG_ACTION
		fi
	}
 * Begin git-reset.sh with something like this:
	#!/bin/sh
	. git-sh-setup
	set_reflog_action "reset $*"
 * Update Porcelain-ish commands that use git-reset in the same
   way.  For example, git-rebase could say:
	#!/bin/sh
	. git-sh-setup
	set_reflog_action "rebase $*"

Then calls to "git-update-ref -m" could use the value of "$GIT_REFLOG_ACTION", without explicit --reflog-action= parameters and $rloga variables.

Hmm?
Previous: Shawn O. PearceNext: Shawn Pearce
Message 2 of 4 in “Teach git-reset to let others override its reflog entry.”
  1. 1/2 Teach git-reset to let others override its reflog entry.Shawn O. Pearce, Dec 28, 2006
  2. Junio C HamanoDec 28, 2006
  3. Shawn PearceDec 28, 2006
  4. Jakub NarebskiDec 28, 2006

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.