git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ted Pavlic <ted@tedpavlic.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: gitster <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] Added giteditor script to show diff while editing commit message.
Date: Wed, 21 Jan 2009 20:46:07 -0500	[thread overview]
Message-ID: <4977CFDF.4040200@tedpavlic.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0901212343100.3586@pacific.mpi-cbg.de>

>> Thanks for your comments. I've responded below. I just want to
>> top-respond to your comment that the fundamental problem is that the
>> diff is in a separate file. In fact, this is the point of the script. I
>> want to be able to scroll through the diff output independent of the
>> commit message.
> Once again, note that e.g. vi will not cope with the way you try to
> achieve that.

It does for me just fine. In vi, I hit ^W^W and move from commit message 
to diff and back. What's the problem with that? In gvim I'm able to 
click back and forth.

I have been using this method for a long time with hg, and now I've been 
using it with git. This isn't theory --- it's been working in practice 
for me. Am I missing something?

> Why not .git/?  That would be the _natural_ place to put it.

Why doesn't stg do that? I figured stg would be a well-established 
program to pattern behavior off of.

I'll rev-parse the git dir and place the file there.

>>> vi users will hate you, as you do not give them a chance to edit the
>>> message after having seen the diff.
>> I don't see what you mean. I am a vi user (exclusively), and this script
>> works very well for me.
> I cannot go back to the commit message when I said ":n" to get to the
> diff.

vi opens for me and I see two windows. The top window shows the commit 
message and the bottom window shows the diff.

I hit ^W^W (or ^W<Down>) and I find myself scrolling around in the diff. 
I hit ^W^W again (or ^W<Up>) and I find myself scrolling around in the 
commit.

Similarly, gvim lets me mouse around both --- clicking from window to 
window.

If you must use ":n", I don't know why you can't use ":prev" to go back. <?>

>> Is there no value in having the diff in a separate file?
> In my case, no, for 2 reasons:
> - I can always open a new shell (in ssh connections, I use screen) to get
>    the diff, and even better: I can restrict it to certain files, and I can
>    use the nice bookmarks "less" provides; dunno if vi would have them.

vi does.

> - My preference is definitely to look at the diff before committing, to be
>    certain that I did not fsck up.  And nothing would annoy me more than to
>    be in the middle of editing a commit message while I am looking at the
>    diff and telling myself "that is a stupid mistake, let's fix it" knowing
>    that the commit will not pick up the fix.

When giving a detailed message bulletting out everything that goes into 
a commit, sometimes it's nice to have a very nearby look at the diff.

>    So seeing the diff while composing the commit message is definitely too
>    late for me.

Nevertheless, the secondary purpose of the contributed script is to show 
how GIT_EDITOR can be used to wrap around other editors. (that's the 
purpose of Mercurial's distributed "hgeditor" script as well)

--Ted


-- 
Ted Pavlic <ted@tedpavlic.com>

   Please visit my ALS association page:
         http://web.alsa.org/goto/tedpavlic
   My family appreciates your support in the fight to defeat ALS.

      reply	other threads:[~2009-01-22  1:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-21 20:47 [PATCH] Added giteditor script to show diff while editing commit message ted
     [not found] ` <0E82F261-2D96-4204-9906-C5E8D47E9A5D@wincent.com>
2009-01-21 21:07   ` Ted Pavlic
2009-01-21 21:46 ` Johannes Schindelin
2009-01-21 22:33   ` Ted Pavlic
2009-01-21 22:45     ` [PATCH] contrib: A script to show diff in new window " Ted Pavlic
2009-01-21 23:59       ` Junio C Hamano
2009-01-22  3:39         ` Ted Pavlic
2009-01-22  3:50         ` Ted Pavlic
2009-01-22  7:49           ` Junio C Hamano
2009-01-21 22:52     ` [PATCH] Added giteditor script to show diff " Johannes Schindelin
2009-01-22  1:46       ` Ted Pavlic [this message]

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=4977CFDF.4040200@tedpavlic.com \
    --to=ted@tedpavlic.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).