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

Re: [RFC] Teach git-branch howto rename a branch

From
LHLars Hjemli <lh@elementstorage.no>
Date
Nov 25, 2006, 09:16 UTC
Message-ID
<8c5c35580611250116h466e3649p2630ee6641b6e6f4@mail.gmail.com>
In-Reply-To
<20061125085731.GG4528@spearce.org>
On 11/25/06, Shawn Pearce <spearce@spearce.org> wrote:
Show 7 quoted lines
> Jakub Narebski <jnareb@gmail.com> wrote:
> >
> > And of course reflog should store the fact of renaming branch.
>
> Yes, I think that's a worthwhile thing to log.  Problem is the
> logging system tends to throw away pointless entries (sha1 ->
> same sha1) so the rename log entry needs to be forced somehow...
Is it ok to put
static int log_ref_write(struct ref_lock *lock,
	const unsigned char *sha1, const char *msg)
into refs.h?
Then it should be possibly to do something like this:
  lock = lock_ref_sha1(ref, sha1);
  lock->force_write = 1;
  log_ref_write(lock, sha1, "Renamed oldname to newname");
  unlock_ref(lock);
...after moving the reflog...
Previous: Shawn PearceNext: Junio C Hamano
Message 6 of 13 in “[RFC] Teach git-branch howto rename a branch”
  1. Lars HjemliNov 24, 2006
  2. Junio C HamanoNov 25, 2006
  3. Shawn PearceNov 25, 2006
  4. Jakub NarebskiNov 25, 2006
  5. Shawn PearceNov 25, 2006
  6. Lars HjemliNov 25, 2006
  7. Junio C HamanoNov 25, 2006
  8. Lars HjemliNov 25, 2006
  9. git-branch -D: make it work even when on a yet-to-be-born branchJunio C Hamano, Nov 25, 2006
  10. Lars HjemliNov 25, 2006
  11. Fredrik KuivinenNov 25, 2006
  12. Lars HjemliNov 25, 2006
  13. Josef WeidendorferNov 26, 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.