more design work
This commit is contained in:
parent
12267089f0
commit
3dea8f0533
1 changed files with 17 additions and 7 deletions
|
@ -6,26 +6,36 @@ mode first, which can range from annoying to really annoying to impossible
|
||||||
|
|
||||||
## general approach
|
## general approach
|
||||||
|
|
||||||
`git annex foo $gitcmd` could:
|
`git annex proxy $gitcmd` could:
|
||||||
|
|
||||||
1. check out a local clone of the repo
|
1. check out a local clone of the repo
|
||||||
2. run "git $gitcmd" inside the cline
|
2. run "git $gitcmd" inside the clone
|
||||||
3. merge any changes from the clone back into the direct mode repo
|
3. Merge any changes from the clone back into the direct mode repo
|
||||||
and update the work tree the same as is done by `git annex merge`.
|
and update the work tree the same as is done by `git annex merge`.
|
||||||
|
4. If a different branch was checked out in the clone, update the repo
|
||||||
|
to have that same branch checked out.
|
||||||
|
|
||||||
This is a general bypass for the direct mode guard. It should work anywhere
|
This is a general bypass for the direct mode guard. It should work anywhere
|
||||||
(even on FAT). It avoids problems like `git commit -a` being unsafe in
|
(even on FAT). It avoids problems like `git commit -a` being unsafe in
|
||||||
direct mode, since running such a command in a local clone, which does not
|
direct mode, since running such a command in a local clone, which does not
|
||||||
use direct mode is always safe.
|
use direct mode is always safe.
|
||||||
|
|
||||||
|
Beyond handling undo, #4 means that this can be used to check
|
||||||
|
out past versions of the repo (eg, `git annex proxy checkout HEAD^^`)
|
||||||
|
|
||||||
One problem with it is that it can only operate on changes that have been
|
One problem with it is that it can only operate on changes that have been
|
||||||
committed. If you've just accidentially deleted a file and want to undo
|
committed. If you've just accidentially deleted a file and want to undo
|
||||||
that, and haven't run `git annex sync` to commit it, you can't revert it.
|
that, and haven't run `git annex sync` to commit it, you can't revert it.
|
||||||
|
|
||||||
Also, while this is general, I don't know if the generality is useful.
|
The need to make a local clone will make it a bit slow, since the whole
|
||||||
What other changes, than revert, would it make sense to do with such a
|
work tree will need to be set up. It might be possible to reuse the clone
|
||||||
command? It could be used to check out some other branch, but step 3 above
|
next time (after resetting it to reflect the current HEAD).
|
||||||
would merge that branch back into the direct mode repo.
|
|
||||||
|
Some things like the reflog and local branches don't get cloned, so
|
||||||
|
git commands that try to act on those wouldn't work. Maybe it would be
|
||||||
|
better to make it use a separate work tree, but the same .git directory?
|
||||||
|
Then step #3 would instead update the direct mode work tree to refect
|
||||||
|
the new HEAD, and step #4 would not be needed.
|
||||||
|
|
||||||
## git annex undo
|
## git annex undo
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue