From 859d57514518e10f3648de2ab1896c689af88164 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 13 Nov 2008 14:19:38 -0500 Subject: Added Hubert Chathi's git set-root bug report. Bug report patch from http://void.printf.net/pipermail/be-devel/attachments/20080623/49500aaf/0cad.bin Reporting thread [Be-devel] Re: set-root in git repository fails Hubert Chathi hubert at uhoreg.ca Tue Jun 24 03:49:23 BST 2008 http://void.printf.net/pipermail/be-devel/2008-June/000038.html --- .../17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/body | 29 ++++++++++++++++++++++ .../17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/values | 21 ++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/body create mode 100644 .be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/values (limited to '.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e') diff --git a/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/body b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/body new file mode 100644 index 0000000..49fe1fb --- /dev/null +++ b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/body @@ -0,0 +1,29 @@ +It looks like the problems with the git backend are more than just in the +site-init command. It looks like several places expect that git_dir_for_path +and git_repo_for_path return absolute paths, while in the current +implementation, it may not be the case. Here is an updated patch to fix this. +This replaces the previous patch that I gave in this bug. It seems to work for +me, but I haven't heavily tested it. + +--- libbe/git.py 2008-06-22 19:52:14.000000000 -0400 ++++ /libbe/git.py 2008-06-23 22:39:17.000000000 -0400 +@@ -102,11 +102,16 @@ + """Find the root of the deepest repository containing path.""" + # Assume that nothing funny is going on; in particular, that we aren't + # dealing with a bare repo. +- return os.path.dirname(git_dir_for_path(path)) ++ # "git rev-parse --show-cdup" gives the relative path to the top-level ++ # directory of the repository. We then join that to the requested path, ++ # and then use realpath to turn it into an absolute path and to get rid of ++ # ".." components. ++ return os.path.realpath(os.path.join(path,invoke_client("rev-parse", "--show-cdup", directory=path)[1].rstrip())) + + def git_dir_for_path(path): + """Find the git-dir of the deepest repo containing path.""" +- return invoke_client("rev-parse", "--git-dir", directory=path)[1].rstrip() ++ repo = git_repo_for_path(path) ++ return os.path.join(repo,invoke_client("rev-parse", "--git-dir", directory=repo)[1].rstrip()) + + def export(spec, bug_dir, revision_dir): + """Check out commit 'spec' from the git repo containing bug_dir into + diff --git a/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/values b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/values new file mode 100644 index 0000000..1350ffb --- /dev/null +++ b/.be/bugs/0cad2ac6-76ef-4a88-abdf-b2e02de76f5c/comments/17a2217e-fc1d-4d7a-a569-4fd2a4a2261e/values @@ -0,0 +1,21 @@ + + + +Content-type=text/plain + + + + + + +Date=Tue, 24 Jun 2008 02:45:18 +0000 + + + + + + +From=hubert + + + -- cgit