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

Re: Using a different index and HEAD

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 13, 2010, 20:21 UTC
Message-ID
<20101113202146.GA16920@burratino>
In-Reply-To
<20101113194128.GA8878@nibiru.local>
Enrico Weigelt wrote:
Show 6 quoted lines
> I didnt have time for a deeper look yet, but I'll try to explain
> my ideas a bit more:
>
> Suppose I choose to work on an branch "one" (which probably is
> synced to some remote). That will create some temporary (local)
> WIP branch, where
[...]
Show 5 quoted lines
>              Now I click some "commit" button and it asks me what
> exactly to commit - I now can interactively selected changes to
> be committed (maybe even on single changelets within a file),
> they'll be squashed together (maybe involving some rebase magic)
> and an commit final commit object is created on the "one" branch.
Ah, that is completely different. :)  Your tools would be
	GIT_INDEX_FILE=$GIT_DIR/wip-index; export GIT_INDEX_FILE
	git update-index ...
	git write-tree
	git commit-tree ...
	git update-ref ...
	git read-tree ...
none of which touch HEAD except the second to last one.

See the list of "low-level commands (plumbing)" and examples in contrib/examples for more details.

Previous: Enrico Weigelt
Message 5 of 5 in “Using a different index and HEAD”
  1. Enrico WeigeltNov 13, 2010
  2. Jakub NarebskiNov 13, 2010
  3. Tomas CarneckyNov 21, 2010
  4. Enrico WeigeltNov 13, 2010
  5. Jonathan NiederNov 13, 2010

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.