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

Re: [PATCH] branch: say "Reset to" in reflog entries for 'git branch -f' operations

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 9, 2010, 12:20 UTC
Message-ID
<4BBF1B80.8050307@viscovery.net>
In-Reply-To
<vpqk4sgltoh.fsf@bauges.imag.fr>
Am 4/9/2010 14:03, schrieb Matthieu Moy:
Show 14 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> But I also have a functional question: Is "start_from" really the ref
>> *to* which the branch is reset? I hope reset does it right.
> 
> I don't know which is which, but if start_from is the destination of
> the ref, then it should be renamed. I don't think we want to have this
> 
> 		snprintf(msg, sizeof msg, "branch: Reset to %s",
>                                                          ^^
>  			 start_name);
>                          ^^^^^
> 
> in the code.
I think the patch is right.
The "start" part refers to where the branch forks off of existing history.

In the case were an existing branch is pointed to a new commit, the "Reset to" is indeed correct. IIUC, the "start_name" is what was given on the command line as fork point (or HEAD if not given). For example, after

   git branch -f thebranch master~23
the reflog of 'thebranch' would now read as "Reset to master~23".
-- Hannes
Previous: Matthieu MoyNext: Tay Ray Chuan
Message 4 of 6 in “branch: say "Reset to" in reflog entries for 'git branch -f' operations”
  1. branch: say "Reset to" in reflog entries for 'git branch -f' operationsTay Ray Chuan, Apr 9, 2010
  2. Michael J GruberApr 9, 2010
  3. Matthieu MoyApr 9, 2010
  4. Johannes SixtApr 9, 2010
  5. Tay Ray ChuanApr 9, 2010
  6. branch: say "Reset to" in reflog entries for 'git branch -f' operationsTay Ray Chuan, Apr 9, 2010

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.