git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix install-doc-quick target

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2007, 07:07 UTC
Message-ID
<7vmyx6fohv.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<46B4F91D.1070907@lsrfire.ath.cx>

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@pobox.com>
---
 * 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
Previous: René ScharfeNext: Johannes Schindelin
Message 10 of 36 in “rc4 - make quick-install-doc is broken”
  1. Mark LevedahlAug 4, 2007
  2. Johannes SchindelinAug 4, 2007
  3. Mark LevedahlAug 4, 2007
  4. Johannes SchindelinAug 4, 2007
  5. Mark LevedahlAug 4, 2007
  6. Johannes SchindelinAug 4, 2007
  7. Mark LevedahlAug 4, 2007
  8. Fix quick-install-docJohannes Schindelin, Aug 4, 2007
  9. René ScharfeAug 4, 2007
  10. Fix install-doc-quick targetJunio C Hamano, Aug 5, 2007
  11. Johannes SchindelinAug 5, 2007
  12. Junio C HamanoAug 5, 2007
  13. Johannes SchindelinAug 5, 2007
  14. Johannes SchindelinAug 5, 2007
  15. (Really) Fix install-doc-quick targetMark Levedahl, Aug 6, 2007
  16. Johannes SchindelinAug 6, 2007
  17. Junio C HamanoAug 6, 2007
  18. Mark LevedahlAug 6, 2007
  19. Johannes SchindelinAug 6, 2007
  20. Mark LevedahlAug 6, 2007
  21. Junio C HamanoAug 7, 2007
  22. Mark LevedahlAug 7, 2007
  23. Junio C HamanoAug 7, 2007
  24. René ScharfeAug 7, 2007
  25. Johannes SchindelinAug 7, 2007
  26. Mark LevedahlAug 4, 2007
  27. Johannes SchindelinAug 4, 2007
  28. Mark LevedahlAug 4, 2007
  29. René ScharfeAug 4, 2007
  30. Johannes SchindelinAug 4, 2007
  31. Mark LevedahlAug 4, 2007
  32. Johannes SchindelinAug 4, 2007
  33. René ScharfeAug 4, 2007
  34. Johannes SchindelinAug 4, 2007
  35. Johannes SchindelinAug 4, 2007
  36. René ScharfeAug 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.