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

Re: Revisiting metadata storage

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 16, 2011, 07:52 UTC
Message-ID
<20111216075251.GA4048@elie.hsd1.il.comcast.net>
In-Reply-To
<CAE1pOi2TGWmFErcKhQu-a37JjLh22O1zFYoBaVRyfBDFjOTE9Q@mail.gmail.com>
Hilco Wijbenga wrote:
>                        Right now every rebase means a full (and almost
> completely unnecessary) rebuild.

It sounds like what you are suffering from is that "git rebase" uses the worktree as its workspace instead of doing all that work in-memory, right?

If I were in your situation, I would do the following:
 1. Don't rebase so often.  When wanting to take advantage of features
    from a new upstream version, use "git merge" to pull it in.  Only
    rebase when it is time to make the history presentable for other
    people.
    This way, "git log --first-parent" will give easy access to
    the intermediate versions you have hacked on and tested recently.
 2. When history gets ugly and you want to rebase to make the series
    easier to make sense of, use a separate workdir:
	$ git branch tmp; # make a copy to rebase
	$ cd ..
	$ git new-workdir repo rebase-scratch tmp
	$ cd rebase-scratch
	$ git rebase -i origin/master
	...
	$ cd ..
	$ rm -fr rebase-scratch
	$ cd repo
	$ git diff HEAD tmp;	# Does the rebased version look better?
	$ git reset --keep tmp;	# Yes.  Use it.
	$ git branch -d tmp
 3. Once the rebased history looks reasonably good, be sure to rebase
    one final time and test each commit before submitting for other
    people's use.

Hope that helps, Jonathan

Previous: Hilco WijbengaNext: Hilco Wijbenga
Message 5 of 7 in “Revisiting metadata storage”
  1. Richard HartmannNov 14, 2011
  2. Jonathan NiederNov 24, 2011
  3. Richard HartmannDec 14, 2011
  4. Hilco WijbengaDec 15, 2011
  5. Jonathan NiederDec 16, 2011
  6. Hilco WijbengaDec 16, 2011
  7. Jonathan NiederDec 17, 2011

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.