git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] RFC - Say goodbye to the rodent

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Aug 5, 2009, 11:54 UTC
Message-ID
<vpqljlycw77.fsf@bauges.imag.fr>
In-Reply-To
<1249465906-3940-1-git-send-email-ayiehere@gmail.com>
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.

Show 15 quoted lines
> 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
Previous: Andreas EricssonNext: Jeff King
Message 15 of 17 in “RFC - Say goodbye to the rodent”
  1. RFC - Say goodbye to the rodentNazri Ramliy, Aug 5, 2009
  2. 1/6 Teach --id/-d to "git status"Nazri Ramliy, Aug 5, 2009
  3. 2/6 Teach --id to "git add"Nazri Ramliy, Aug 5, 2009
  4. 3/6 Teach --id to "git checkout"Nazri Ramliy, Aug 5, 2009
  5. 4/6 Teach --d to "git commit"Nazri Ramliy, Aug 5, 2009
  6. 5/6 Teach --id to "git rm"Nazri Ramliy, Aug 5, 2009
  7. 6/6 Teach --id to "git reset"Nazri Ramliy, Aug 5, 2009
  8. Alex RiesenAug 5, 2009
  9. Sverre RabbelierAug 5, 2009
  10. Junio C HamanoAug 5, 2009
  11. Sverre RabbelierAug 5, 2009
  12. Alex RiesenAug 5, 2009
  13. Sverre RabbelierAug 5, 2009
  14. Andreas EricssonAug 5, 2009
  15. Matthieu MoyAug 5, 2009
  16. Jeff KingAug 5, 2009
  17. Nicolas PitreAug 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.