threads / discuss / 9268

suggestion for git rebase -i

Subject: suggestion for git rebase -i

## tl;dr

7 messages between Jul 28, 2007 and Jul 28, 2007.

replies: 6people: 3as markdown or json

Seth Falcon· Jul 28, 2007, 04:58 UTC · lore

The tempfile used by git rebase -i is called "todo". For those using something like emacsclient, this is a bit too generic for the name of a file in a pre-existing editor session. I realize this is a small nit, but how about renaming the file to "git-rebase-todo"?

+ seth
-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
BioC: http://bioconductor.org/
Blog: http://userprimary.net/user/
Johannes Schindelin· Jul 28, 2007, 08:43 UTC · re: Seth Falcon · lore

Re: suggestion for git rebase -i

Hi,
On Fri, 27 Jul 2007, Seth Falcon wrote:
> The tempfile used by git rebase -i is called "todo".  For those using
> something like emacsclient, this is a bit too generic for the name of
> a file in a pre-existing editor session.  I realize this is a small
> nit, but how about renaming the file to "git-rebase-todo"?
Why?  This is an implementation detail, and should not concern the user.

However, I was thinking about adding a "git rebase --status" to show where you are, but that will have to be implemented by someone else, or it has to wait a little.

Ciao, Dscho

Jeff King· Jul 28, 2007, 08:45 UTC · re: Johannes Schindelin · lore

Re: suggestion for git rebase -i

On Sat, Jul 28, 2007 at 09:43:15AM +0100, Johannes Schindelin wrote:
> > a file in a pre-existing editor session.  I realize this is a small
> > nit, but how about renaming the file to "git-rebase-todo"?
> 
> Why?  This is an implementation detail, and should not concern the user.

Because if you want to setup macros or syntax highlighting specific to editing git-rebase tempfiles, then you have to figure out somehow that you are editing one. Using a more informative name for the tempfile means that you can guess based on the filename.

-Peff
Jeff King· Jul 28, 2007, 08:58 UTC · re: Jeff King · lore

Re: suggestion for git rebase -i

On Sat, Jul 28, 2007 at 04:45:51AM -0400, Jeff King wrote:
Show 9 quoted lines
> > > a file in a pre-existing editor session.  I realize this is a small
> > > nit, but how about renaming the file to "git-rebase-todo"?
> > 
> > Why?  This is an implementation detail, and should not concern the user.
> 
> Because if you want to setup macros or syntax highlighting specific to
> editing git-rebase tempfiles, then you have to figure out somehow that
> you are editing one. Using a more informative name for the tempfile
> means that you can guess based on the filename.

Re-reading his original message, I actually don't think this is what he wanted it for. But I think it's reasonable to give the tempfile a meaningful name anyway for this reason.

-Peff
Seth Falcon· Jul 28, 2007, 15:52 UTC · re: Johannes Schindelin · lore

Re: suggestion for git rebase -i

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Why?  This is an implementation detail, and should not concern the
> user.

In the context of an existing editing session, the name of the tempfile is visible and relevant to the user (not just an implementation detail). For example, the tempfile name is useful when multi-tasking and one needs to get back to the buffer. As another reply pointed out, the name could also be used for editor mode customization.

So. When editing a commit message, the buffer is named COMMIT_EDITMSG. When editing a rebase -i buffer it is named todo. Is this a real problem? Of course not. But I think a slightly more descriptive name makes sense -- especially if other commands gain interactive modes and a user might have a number of them going at once (in different repos, e.g.).

+ seth
Johannes Schindelin· Jul 28, 2007, 20:09 UTC · re: Seth Falcon · lore

Re: suggestion for git rebase -i

Hi,
On Sat, 28 Jul 2007, Seth Falcon wrote:
Show 9 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > Why?  This is an implementation detail, and should not concern the
> > user.
> 
> In the context of an existing editing session, the name of the tempfile 
> is visible and relevant to the user (not just an implementation detail).  
> For example, the tempfile name is useful when multi-tasking and one 
> needs to get back to the buffer.  As another reply pointed out, the name 
> could also be used for editor mode customization.

Okay, fair enough. But since you want that feature, you get to do the patch. Hint: it is just one line that has to be changed.

Ciao, Dscho

Seth Falcon· Jul 28, 2007, 23:11 UTC · re: Johannes Schindelin · lore

Re: suggestion for git rebase -i

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Okay, fair enough.  But since you want that feature, you get to do the 
> patch.  Hint: it is just one line that has to be changed.

Heh, I actually wrote the patch first, but thought it was so trivial... :-)

ok, I will send the patch and hopefully not screw up the formatting, etc. Feedback and hints welcome.

+ seth

← back to recent threads