git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: Nazri Ramliy <ayiehere@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] RFC - Say goodbye to the rodent
Date: Wed, 05 Aug 2009 13:54:36 +0200	[thread overview]
Message-ID: <vpqljlycw77.fsf@bauges.imag.fr> (raw)
In-Reply-To: <1249465906-3940-1-git-send-email-ayiehere@gmail.com> (Nazri Ramliy's message of "Wed\,  5 Aug 2009 17\:51\:40 +0800")

Nazri Ramliy <ayiehere@gmail.com> writes:

> Oftentimes I get tired of moving my hand away from the comfort of the home rows
> of my keybard in order to grab the mouse to highlight the files that I'd like
> to operate on.

Usually, when you cut-and-paste from $(git status), it's to run a
staging/unstaging command, or to view a diff.

Actually, "git add -i" is already a pretty good way of doing this,
with few keystrokes.
> Example:
>
> $ git status --id
> # On branch local
> # Changed but not updated:
> #   (use "git add <file>..." to update what will be committed)
> #   (use "git checkout -- <file>..." to discard changes in working directory)
> #
> #       modified:   builtin-write-tree.c (m1)
> #
> # Untracked files:
> #   (use "git add <file>..." to include in what will be committed)
> #
> #       file1.c (x1)
> #       file2.c (x2)

$ git add -i
           staged     unstaged path
  1:    unchanged        +1/-0 builtin-write-tree.c

*** Commands ***
  1: [s]tatus     2: [u]pdate     3: [r]evert     4: [a]dd untracked
  5: [p]atch      6: [d]iff       7: [q]uit       8: [h]elp

> Now we can do the following:
>
> $ git add --id m1

What now> u
           staged     unstaged path
  1:    unchanged        +1/-0 [b]uiltin-write-tree.c
Update>> 1
           staged     unstaged path
* 1:    unchanged        +1/-0 [b]uiltin-write-tree.c
Update>> 
updated one path

*** Commands ***
  1: [s]tatus     2: [u]pdate     3: [r]evert     4: [a]dd untracked
  5: [p]atch      6: [d]iff       7: [q]uit       8: [h]elp

> Ids are specified via the --id command line option, and can be separated with
> commas if you want to specify more than one of them:
>
> $ git add --id m1,x2

What now> a
  1: file1.c
  2: file2.c
Add untracked>> 1
* 1: file1.c
  2: file2.c
Add untracked>> 2
* 1: file1.c
* 2: file2.c
Add untracked>> 
added 2 paths

for these examples, I have far fewer keystrokes with "git add -i" than
you have. I don't think it's worth adding yet-another-option to most
Git commands since it doesn't really bring much IMHO.

-- 
Matthieu

  parent reply	other threads:[~2009-08-05 11:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-05  9:51 [PATCH] RFC - Say goodbye to the rodent Nazri Ramliy
2009-08-05  9:51 ` [PATCH 1/6] Teach --id/-d to "git status" Nazri Ramliy
2009-08-05  9:51   ` [PATCH 2/6] Teach --id to "git add" Nazri Ramliy
2009-08-05  9:51     ` [PATCH 3/6] Teach --id to "git checkout" Nazri Ramliy
2009-08-05  9:51       ` [PATCH 4/6] Teach --d to "git commit" Nazri Ramliy
2009-08-05  9:51         ` [PATCH 5/6] Teach --id to "git rm" Nazri Ramliy
2009-08-05  9:51           ` [PATCH 6/6] Teach --id to "git reset" Nazri Ramliy
2009-08-05 18:11   ` [PATCH 1/6] Teach --id/-d to "git status" Alex Riesen
2009-08-05 18:25     ` Sverre Rabbelier
2009-08-05 18:27       ` Junio C Hamano
2009-08-05 18:30         ` Sverre Rabbelier
2009-08-05 18:33       ` Alex Riesen
2009-08-05 18:35         ` Sverre Rabbelier
2009-08-05 10:04 ` [PATCH] RFC - Say goodbye to the rodent Andreas Ericsson
2009-08-05 11:54 ` Matthieu Moy [this message]
2009-08-05 19:02 ` Jeff King
2009-08-05 20:01   ` Nicolas Pitre

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=vpqljlycw77.fsf@bauges.imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=ayiehere@gmail.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).