[PATCH] Fix install-doc-quick target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The script starts in a subdirectory of the source directory to
muck with a branch whose structure does not have anything to
do with the actual work tree.  Go up to the top to make it clear
that we operate on the whole tree.

It also exported GIT_DIR without any good reason.  Remove it.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---

 * I am getting the impression that the semantics of the updated
   work-tree support is as broken as the original, although the
   code that implements it is easier to read.  

   Admittedly, this is an unorthodox corner case usage, that
   deals with a tree structure that does not have any relation
   with the current project state, and the script is started
   with a subdirectory of the current project.  What is needed
   is a way to tell git that "we may be in a subdirectory but
   the tree structure we are dealing with does not have anything
   to do with the current work tree structure -- ignore the fact
   that we are not at the toplevel", and exporting of GIT_DIR
   was the way to do so in the old world order.

   Another way to do this in the new world order would be to
   pass "--work-tree=.", but this has its own problems it
   seems.  You can try commenting out cd_to_toplevel this patch
   introduces, then rewrite checkout-index part with:

    git --git-dir="$GIT_DIR" --work-tree=. checkout-index -a...

   which seems to work, but if you drop --git-dir="$GIT_DIR"
   from the above (without reintroducing the export of GIT_DIR),
   you get "fatal: Could not switch to '.git'" which seems quite
   bogus.  If you say:

	git --work-tree=. foo

   without saying anything about GIT_DIR, shouldn't we run the
   usual .git/ discovery, going up the directories? 

 Documentation/install-doc-quick.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/install-doc-quick.sh b/Documentation/install-doc-quick.sh
index e6601bd..07d227f 100755
--- a/Documentation/install-doc-quick.sh
+++ b/Documentation/install-doc-quick.sh
@@ -7,7 +7,7 @@ mandir="$2"
 SUBDIRECTORY_OK=t
 USAGE='<refname> <target directory>'
 . git-sh-setup
-export GIT_DIR
+cd_to_toplevel
 
 test -z "$mandir" && usage
 if ! git rev-parse --verify "$head^0" >/dev/null; then
@@ -18,6 +18,8 @@ fi
 GIT_INDEX_FILE=`pwd`/.quick-doc.index
 export GIT_INDEX_FILE
 rm -f "$GIT_INDEX_FILE"
+trap 'rm -f "$GIT_INDEX_FILE"' 0
+
 git read-tree $head
 git checkout-index -a -f --prefix="$mandir"/
 
-- 
1.5.3.rc4.8.ga120


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux