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

Re: Git commit won't add an untracked file given on the command line

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Nov 19, 2008, 18:01 UTC
Message-ID
<alpine.LNX.1.00.0811191247560.19665@iabervon.org>
In-Reply-To
<7vd4grsveo.fsf@gitster.siamese.dyndns.org>
On Wed, 19 Nov 2008, Junio C Hamano wrote:
Show 19 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > On Wed, 19 Nov 2008, Mark Burton wrote:
> >
> >> Having said that, I still like the concept of being able to add named 
> >> files without touching the index.
> >
> > That's just impossible.  You cannot create a tree object, let alone a 
> > commit object, without touching the index (AKA staging area).
> 
> I do not think Mark really _means_ "not in the index".
> 
> The wish is more like "I want to let git know that I am interested in this
> path, but I'm not ready to say what exact content I want for that path in
> the next commit, not just yet".
> 
> I do not think that is an unreasonable wish.  On the other hand, it is
> unreasonable for anybody to insist that we satisfy the wish without
> touching the index.  The index is the most natural place to do that.

I don't think that's what Mark wants, in this case. He's looking for the ability to have "git commit" act on a temporary index created by adding to the parent commit explicitly named files which aren't in the non-temporary index. That is, Mark doesn't want to touch *the* index, which is fine; git can commit with *an* index.

> We have a half (probably a quarter) of what we need for that implemented
> already, by the way.

I've looked into what you're suggesting on occasion; the main issue is getting the various index users to avoid getting confused. I was stumped by the diff code, which was confusing the "intent to add something" token with its "compare against the work tree" token. I'd say, it's half implemented, but testing is a major unstarted undertaking.

	-Daniel
*This .sig left intentionally blank*
Previous: Mark BurtonNext: Junio C Hamano
Message 15 of 22 in “Git commit won't add an untracked file given on the command line”
  1. Mark BurtonNov 18, 2008
  2. Francis GaliegueNov 18, 2008
  3. Mark BurtonNov 18, 2008
  4. Johannes SchindelinNov 19, 2008
  5. Miles BaderNov 19, 2008
  6. Johannes SchindelinNov 19, 2008
  7. Miles BaderNov 19, 2008
  8. Johannes SchindelinNov 19, 2008
  9. Miles BaderNov 20, 2008
  10. Junio C HamanoNov 19, 2008
  11. Mark BurtonNov 19, 2008
  12. Johannes SchindelinNov 19, 2008
  13. Junio C HamanoNov 19, 2008
  14. Mark BurtonNov 19, 2008
  15. Daniel BarkalowNov 19, 2008
  16. Junio C HamanoNov 19, 2008
  17. Mark BurtonNov 19, 2008
  18. Junio C HamanoNov 19, 2008
  19. Daniel BarkalowNov 19, 2008
  20. Junio C HamanoNov 20, 2008
  21. David AguilarNov 20, 2008
  22. Matthieu MoyNov 18, 2008

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.