diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-03-14 09:51:19 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-14 10:48:18 -0700 |
commit | 717f4ef102efcee479aa42678efe3d74b9cef9b2 (patch) | |
tree | 52811d28058773573cefb62d5556d9281418c388 /save-xml.c | |
parent | 3fe0019bc2939aea4e89cbb8bc5aeb5edeb456d9 (diff) | |
download | subsurface-717f4ef102efcee479aa42678efe3d74b9cef9b2.tar.gz |
git access: allow arbitrary revision specifiers on reading
Commit 13e2210d75bb ("Allow remote branch names when reading a git
object tree") made it possible to read (but not write) remote branches,
which is very convenient when you just want to look at somebody elses
dives in a shared repository.
However, it was really quite stupidly done - both overly complicated,
and overly restrictive.
It's much better and simpler to just allow general git revision
specifications, which includes branches (both remote and local) as a
simple case, but also allows general git revision expressions. So you
can tag things, and use a tag-name instead. Or you can say that you
want to look at the previous save, by using the "branchname^" syntax.
Or, you can use the git reflog, and do things like
subsurface ~/scuba/[linus@{two.days.ago}]
to see the dives that your repository contained two days ago.
Obviously, you will not be able to save to this kind of ref-spec (and I
really will have to make error handling work better), but for browsing
state it's quite useful.
And in git terms, this is actually simpler than the "lets try to first
see if we have a local branch of that name, and then if we have a remote
one", as shown by the fact that this removes more lines than it adds.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
0 files changed, 0 insertions, 0 deletions