git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proposal for git stash rename
@ 2010-06-20  9:31 Greg Hewgill
  2010-06-20 10:54 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Hewgill @ 2010-06-20  9:31 UTC (permalink / raw)
  To: git

I'd like to teach git-stash to rename stashes. Sometimes I'll create a
stash and then later think of a better or more descriptive name for it.
Or, I'll create a stash with "git stash -p" and forget to give it a
useful name, and there's no easy way to undo and redo that without
doing the interactive part again.

I noticed that although the stash message is used as the commit
description for the stash commit(s), it is the message in the reflog
that is actually displayed on "git stash list". So to rename a stash,
changing the message in the reflog is sufficient (this can be
demonstrated with a text editor).

My general idea is:

1. Implement a new "git reflog update" command that updates the message
associated with a specific reflog entry. To do this, a new
update_reflog_ent() function (in reflog.c) would change the message
associated with the specific reflog entry to update. An update_reflog()
function would use for_each_reflog_ent() with update_reflog_ent to
actually do the change.

2. A "git stash rename" command would then only need to call "git
reflog update" with the appropriate ref and new message.

Since this is my first time modifying the Git source, I thought I'd
solicit some feedback on this idea.

- Is this an appropriate approach to implementing this?
- Is there a better way to do it?
- I have a mostly working patch now, but it needs cleanup. What's the
  next step?

Greg Hewgill
http://hewgill.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-09  8:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-20  9:31 Proposal for git stash rename Greg Hewgill
2010-06-20 10:54 ` Ævar Arnfjörð Bjarmason
2010-06-20 11:11   ` Greg Hewgill
2013-01-04 18:25     ` Micheil Smith
2013-01-04 21:40       ` Junio C Hamano
2013-01-09  8:38         ` Michael Haggerty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).