From: Greg Hewgill <greg@hewgill.com>
To: git@vger.kernel.org
Subject: Proposal for git stash rename
Date: Sun, 20 Jun 2010 09:31:42 +0000 [thread overview]
Message-ID: <20100620093142.GF24805@occam.hewgill.net> (raw)
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
next reply other threads:[~2010-06-20 9:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-20 9:31 Greg Hewgill [this message]
2010-06-20 10:54 ` Proposal for git stash rename Æ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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100620093142.GF24805@occam.hewgill.net \
--to=greg@hewgill.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).