All of lore.kernel.org
 help / color / mirror / Atom feed
* fixing workdirs
@ 2010-07-08 11:08 Pierre Habouzit
  2010-07-08 18:37 ` Tait
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pierre Habouzit @ 2010-07-08 11:08 UTC (permalink / raw)
  To: Git ML

[-- Attachment #1: Type: text/plain, Size: 2028 bytes --]

At work we (ab-)use workdirs a lot, though, workdirs aren't for
everybody, and as our company grows, not everybody uses them sanely.

The two problems (that are well known to this list, and is the reason
why git new-workdir is in contrib afaict) with workdirs are:

  - the HEAD reflogs aren't shared, which means that pruning a working
    directory may trash accessible stuff from the reflog of another one.

  - if two workdirs are on the same branch at the same time, really,
    really, *REALLY* bad things may happen if one isn't aware of that
    fact.

I'm intending to adress those issues, though I would like to know how it
would be received. My current plan is this one. Have a git workdir
command, with a few subcommands (create, move, rename, ...), that
addresses both of the previous issues.

for the first one, the fix is simple: workdirs have now a name, and
their HEAD reflog lives in the "master" git repository reflog namespace
under logs/workdir/$workdir_name/HEAD. The workdir HEAD reflog is then a
symlink to the masters.

In this way, all workdirs see all the reflogs of every single workdir,
and pruning is safe again.


For the second one, when a workdir is created, a [workdir "foo"] section
is added to the master directory, with a path configuration variable
pointing to the ... path of the working directory. My plan would be to
teach git checkout to lean about that, and when there are workdirs
set up, git checkout would check that no other workdir is currently "on
the same branch", and would refuse to checkout to a branch that is
already checkouted elsewhere.


The current state of my git-workdir.sh is attached, though before I
start diving into the checkout builtin, I wanted to be sure that's the
way to go, and if there isn't any other issue I could have missed, plus
if this work has any chance to enter git.git :)
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

[-- Attachment #2: git-workdir.sh --]
[-- Type: application/x-sh, Size: 3640 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-17 18:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-08 11:08 fixing workdirs Pierre Habouzit
2010-07-08 18:37 ` Tait
2010-07-08 18:56   ` Joshua Jensen
2010-07-09  7:49   ` Pierre Habouzit
2010-07-08 19:40 ` Junio C Hamano
2010-07-08 19:56   ` Avery Pennarun
2010-07-09  7:56   ` Pierre Habouzit
2010-07-09 22:25     ` Junio C Hamano
2010-07-19  9:02       ` Pierre Habouzit
2010-08-17 18:34 ` Jan Hudec

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.