git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Ebermann <Paul-Ebermann@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH/WIP] completion: complete git diff with only changed files.
Date: Thu, 19 May 2011 14:31:37 +0200	[thread overview]
Message-ID: <4DD50DA9.8010305@gmx.de> (raw)
In-Reply-To: <7voc2zbwz8.fsf@alter.siamese.dyndns.org>

Junio C Hamano schrieb:
> Paul Ebermann <Paul-Ebermann@gmx.de> writes:
> 
>> I'm normally using (for differences to head) git status first, and then
>> have a look at the files I really want to see. Then completion of only
>> the changed files seems useful.
> 
> By the time completion offers you the choices, you already have spent
> enough extra cycles to compute the paths, which is half the cost of
> generating the diff itself.
> 
> I have this nagging feeling that you are trying to solve a problem that
> does not exist.

Maybe.

For me, it is not so much about saving CPU cycles (I have enough of
these) but about not seeing things I don't want to see, and helping me
decide what to type. This might be against the Git philosophy, I'm
starting to realize.

>  Perhaps you have too many things going on in your working
> tree at once, and if git helped in such a way that your workflow does not
> have to touch so many (possibly unrelated) things at once, you do not have
> to worry about unconstrained "git diff" output overwhelming you?

If I only want to do "git diff" (without any paths), I obviously don't
need path completion at all.


Here is an example:

Yesterday, I addes a new Java class (193 lines)
  src/de/hub/sam/es/managementclient/ssh/TunnelSocketImpl.java
and at the same time made some changes to
  src/de/hub/sam/es/managementclient/ssh/ConnectionManager.java
to use this new class (adding 29 lines).

I wanted to look only at the changes made to ConnectionManager.java.

(The changes to TunnelSocketImpl.java were obvious: creating the whole
new class, thus I could look at this in my editor if I wanted).

With the usual filename-completion, this goes like

    git diff -- s<tab><tab><tab><tab><tab><tab>s<tab>C<tab>

If I had a broader package tree (like in some other projects),
it takes even more work, as I must remember which package name
starting letters to type between the tabs.

(In some projects I started to choose the package names so that
there never would be two sibling directories starting with the
same letter, to help autocompletion.)

With the new completion scheme, this would be

   git diff -- <tab>C<tab>

It might need doubled time to complete-and-execute, but
my computer is quite faster than I can type (and think),
even if the .git directory is on a NFS.

(You could ask why my shell working directory is not the
 managementclient directory. The reason is that sometimes
 there are files in ./ which get changed, too.)


Paul

  reply	other threads:[~2011-05-19 12:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18  0:15 [PATCH/WIP] completion: complete git diff with only changed files Paul Ebermann
2011-05-18  5:29 ` Junio C Hamano
2011-05-18 13:22   ` Paul Ebermann
2011-05-18 20:00     ` Junio C Hamano
2011-05-19 12:31       ` Paul Ebermann [this message]
2011-05-19 17:07         ` Junio C Hamano

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=4DD50DA9.8010305@gmx.de \
    --to=paul-ebermann@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.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).