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

Re: RFC: checkout/temporary branch switch restoring modification times

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 4, 2010, 05:11 UTC
Message-ID
<20101004051148.GG24884@burratino>
In-Reply-To
<4CA95B18.5090008@cockos.com>
Hi,
Justin Frankel wrote:
Show 6 quoted lines
> git cop master
> ; build
> git cop some-branch-that-affects-lots-of-files
> ; edit some things, commit
> git cop master
> ; build (fast, nothing changed)

Interesting. I guess the intended use is that you only ever build on the master branch?

Have you ever tried the contrib/workdir/git-new-workdir script? I find it fits the use case well for me:

 git clone $repo
 cd repo
 make
 # oh, shoot! I need to try something out real quick.
 cd ..
 git new-workdir repo repo2 origin/master
 cd repo2
 git am patch-to-test
 make
 # okay, back to what I was doing...
 cd ../repo
Maybe it could be helpful for you, too?
Limitations:
 - requires a file system with support for symbolic links
   (I think Pierre Habouzit and Junio discussed changing
   that);
 - workdirs share refs.  If you update master in one
   workdir and another workdir also has master checked
   out, the new changes will appear as staged changes.
 - workdirs do not share HEAD.  "git gc" from one
   workdir can completely trash another if it has a
   detached HEAD pointing to a commit that is not part
   of any local or remote branch.
Previous: Ævar Arnfjörð BjarmasonNext: Justin Frankel
Message 3 of 4 in “RFC: checkout/temporary branch switch restoring modification times”
  1. Justin FrankelOct 4, 2010
  2. Ævar Arnfjörð BjarmasonOct 4, 2010
  3. Jonathan NiederOct 4, 2010
  4. Justin FrankelOct 4, 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.