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

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

From
Nicolas Pitre <nico@cam.org>
Date
Aug 5, 2009, 20:01 UTC
Message-ID
<alpine.LFD.2.00.0908051558220.16073@xanadu.home>
In-Reply-To
<20090805190256.GA9004@coredump.intra.peff.net>
On Wed, 5 Aug 2009, Jeff King wrote:
Show 31 quoted lines
> On Wed, Aug 05, 2009 at 05:51:40PM +0800, Nazri Ramliy wrote:
> 
> > The idea is that "git status --id" shows a unique id for each file in
> > its output (modified/staged/unknown/etc). The ids and the
> > corresponding filenames are stored in .git/FILE_IDS. This file gets
> > overwritten everytime you run "git status --id"
> 
> But files _already_ have a unique id: the filename. You never say why
> those unique ids must be cut-and-pasted using the mouse when your unique
> ids would be suitable for typing, but I'll assume it's because your
> unique ids are much shorter than your filenames.
> 
> There are already two classes of solutions to this problem:
> 
>   1. Make typing the filenames easier. Generally, this is accomplished
>      by tab completion. Even stock bash (and other shells) should
>      complete filenames easily, but you can also complete much more
>      using the programmable bash completion included with git.
> 
>      The main advantage of this approach is that it is totally
>      generalizable. Anytime you have to input a filename, you can use
>      it.
> 
>   2. Structure your workflow to iterate over the list of items to be
>      acted on, and then select actions for each item. This is what "git
>      add -i" does, as well as "git mergetool" and "git difftool".
> 
>      This can save a lot of typing over (1), but requires a new script
>      for every such workflow (e.g., the scripts above cover only adding,
>      resolving merges, and diffing; you would need a new script to
>      iterate over files, doing "git checkout" on each one, for example).
BTW I often use this incantation:
	xargs git add
	[paste list of files obtained from git status output]
	^D
Nicolas
Previous: Jeff King
Message 17 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.