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

Re: Importing from tarballs; add, rm, update-index?

From
Julian Phillips <julian@quantumfyre.co.uk>
Date
Jan 13, 2007, 16:27 UTC
Message-ID
<Pine.LNX.4.64.0701131620100.19099@beast.quantumfyre.co.uk>
In-Reply-To
<20070113161936.GB4825@xp.machine.xx>
On Sat, 13 Jan 2007, Peter Baumann wrote:
Show 22 quoted lines
> I'd favour the following model:
>
> git-add: register the content of a previously unkown file to git
>    (there was now struct chache_entry in the index previously which
>     described a file with the same name)
>
> git-rm: remove a struct cache_entry from the index and after some
>    safty checks remove the file, too. (see in the mailinglist archive;
>    there was much talk about git-rm and its semantic)
>
> git-refresh (or git-stage or git-update or what-ever you call it):
>    replace the cache_entry by a new one
>
> And this all about content; the content which would represent my next
> tree object. Because developers don't think of "add" if they want to
> remove a file from the commit. If the power users liked to have only one
> command, wich does remove, add and update then lets not call it add.
> Better make this commmand the above mentioned git-refresh which would do
> "the right thing" if called with a new file/removed file
>
> Im simply think its confusing to call the described command git-add, as
> we have it now. It's at least *very* confusing for new starters.

Personally I actually find having a single add command to be the simplest conceptual model ...

I think of it like this:
* start off with current content (index matches HEAD matches working tree)
* I do some stuff (add files, edit files, delete files)
* I add my changes to the index
* I do more stuff
* I add my changes to the index
* I do more stuff
* I realise that the latest changes are actually different, so I commit 
the index, and then keep going, or I add the changes and commit.

The only thing I find slightly confusing is that the staging area for the next commit is called the index.

(But then maybe I've been reading this list too long - though I have only actually starting playing with git recently)

-- 
Julian

  ---
Power, like a desolating pestilence,
Pollutes whate'er it touches...
 		-- Percy Bysshe Shelley
Previous: Peter BaumannNext: Junio C Hamano
Message 11 of 38 in “Importing from tarballs; add, rm, update-index?”
  1. Chris RiddochJan 12, 2007
  2. Morten WelinderJan 12, 2007
  3. Junio C HamanoJan 12, 2007
  4. Peter BaumannJan 12, 2007
  5. Junio C HamanoJan 12, 2007
  6. Peter BaumannJan 12, 2007
  7. Junio C HamanoJan 13, 2007
  8. Peter BaumannJan 13, 2007
  9. Johannes SchindelinJan 13, 2007
  10. Peter BaumannJan 13, 2007
  11. Julian PhillipsJan 13, 2007
  12. Junio C HamanoJan 13, 2007
  13. Carl WorthJan 13, 2007
  14. Brian GernhardtJan 13, 2007
  15. Peter BaumannJan 13, 2007
  16. Nicolas PitreJan 13, 2007
  17. Carl WorthJan 13, 2007
  18. Junio C HamanoJan 13, 2007
  19. Nicolas PitreJan 13, 2007
  20. Brian GernhardtJan 13, 2007
  21. Peter BaumannJan 13, 2007
  22. Brian GernhardtJan 13, 2007
  23. Alan ChandlerJan 13, 2007
  24. Brian GernhardtJan 13, 2007
  25. Shawn O. PearceJan 13, 2007
  26. Johannes SchindelinJan 14, 2007
  27. Shawn O. PearceJan 14, 2007
  28. Junio C HamanoJan 15, 2007
  29. Shawn O. PearceJan 15, 2007
  30. Daniel BarkalowJan 15, 2007
  31. Horst H. von BrandJan 16, 2007
  32. Daniel BarkalowJan 16, 2007
  33. Christian MICHONJan 16, 2007
  34. Jakub NarebskiJan 16, 2007
  35. Carl WorthJan 12, 2007
  36. Johannes SchindelinJan 12, 2007
  37. Junio C HamanoJan 13, 2007
  38. Jakub NarebskiJan 12, 2007

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.