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

Re: mtimes of working files

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 14, 2007, 00:10 UTC
Message-ID
<alpine.LFD.0.999.0707131704000.20061@woody.linux-foundation.org>
In-Reply-To
<1184370414.2785.79.camel@shinybook.infradead.org>
On Sat, 14 Jul 2007, David Woodhouse wrote:
> 
> On the occasions I actually try to _use_ branches, I find it very
> suboptimal.
This seems to be very personal.

I tend to use just temporary branches, but I love just going on another branch, fixing something up, and working on that without having to set up a whole new tree. It's *much* faster to just switch branches than to do even a local clone, because I usually would work on something that is pretty close to the HEAD anyway, so the cost of rewriting a few hundred files is much less than checking out the 22,000 files all over again.

But I literally tend to just use branches for something small. I don't personally tend to have any long-term live branches (apart from the remove ones, obviously). I create a branch, do something in it, merge it, and go back to master.

The last example of this for me was just re-doing a pull by Ingo, because he had created some really strange commit in his tree, so I fetched his stuff, re-created his branch locally without the thing, and then merged it. And then I just deleted the branch.

> But having to rebuild (even with ccache) after changing branches is a 
> PITA.

I don't even use ccache, and I don't care. Probably because most of the time the rebuild time really isn't that long for me, and for the kernel, the much more painful part is actually the rebooting part.

But the place where branches *really* rock is when you don't even switch to them, but use the data from them locally (cherry-picking from them, or doing something like "git show origin/pu:builtin-blame.c" etc).

And for that to work, you have to get used to having multiple branches in the tree, even if you don't check them out - and once you do that, switching between them isn't really that confusing any more, because it's already part of your "mind map" of how the repo works.

			Linus
Previous: David WoodhouseNext: David Woodhouse
Message 12 of 24 in “mtimes of working files”
  1. Yakov LernerJul 11, 2007
  2. Johannes SchindelinJul 11, 2007
  3. Yakov LernerJul 11, 2007
  4. Johannes SchindelinJul 11, 2007
  5. Jan HudecJul 11, 2007
  6. Andy ParkinsJul 12, 2007
  7. David WoodhouseJul 12, 2007
  8. Theodore TsoJul 13, 2007
  9. David WoodhouseJul 13, 2007
  10. Linus TorvaldsJul 13, 2007
  11. David WoodhouseJul 13, 2007
  12. Linus TorvaldsJul 14, 2007
  13. David WoodhouseJul 14, 2007
  14. J. Bruce FieldsJul 14, 2007
  15. David WoodhouseJul 14, 2007
  16. Jakub NarebskiJul 14, 2007
  17. Robin RosenbergJul 14, 2007
  18. Julian PhillipsJul 14, 2007
  19. Jan HudecJul 14, 2007
  20. Julian PhillipsJul 14, 2007
  21. Daniel BarkalowJul 15, 2007
  22. Eric WongJul 12, 2007
  23. Randal L. SchwartzJul 12, 2007
  24. Eric WongJul 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.