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

[PATCH] checkout-index doc: use --work-dir in the export example

From
Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Date
Aug 11, 2007, 18:15 UTC
Message-ID
<1186856119985-git-send-email-ukleinek@informatik.uni-freiburg.de>
In-Reply-To
<7vhcn6ps4j.fsf@assigned-by-dhcp.cox.net>

The old example used --prefix=.../ to teach the reader that the trailing slash is important. This lesson just moved down to the next example, without a real example though.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
---
Hello Junio,

even if you revert 4465f410 (and add the tests) I'd prefer using --work-tree.

Best regards Uwe

 Documentation/git-checkout-index.txt |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-checkout-index.txt b/Documentation/git-checkout-index.txt
index b1a8ce1..7c19351 100644
--- a/Documentation/git-checkout-index.txt
+++ b/Documentation/git-checkout-index.txt
@@ -143,21 +143,16 @@ $ git-checkout-index -n -f -a && git-update-index --ignore-missing --refresh
 ----------------
 
 Using `git-checkout-index` to "export an entire tree"::
-	The prefix ability basically makes it trivial to use
-	`git-checkout-index` as an "export as tree" function.
-	Just read the desired tree into the index, and do:
+	Just read the desired tree into the index, make sure
+	git-export-dir exists, and do:
 +
 ----------------
-$ git-checkout-index --prefix=git-export-dir/ -a
+$ git --work-dir=git-export-dir checkout-index -a
 ----------------
 +
 `git-checkout-index` will "export" the index into the specified
 directory.
 +
-The final "/" is important. The exported name is literally just
-prefixed with the specified string.  Contrast this with the
-following example.
-
 Export files with a prefix::
 +
 ----------------
@@ -165,7 +160,9 @@ $ git-checkout-index --prefix=.merged- Makefile
 ----------------
 +
 This will check out the currently cached copy of `Makefile`
-into the file `.merged-Makefile`.
+into the file `.merged-Makefile`.  The argument of --prefix is
+literally just prefixed with the specified string, so if you want to
+export to a directory you must end the prefix with a slash.
 
 
 Author
-- 
1.5.3.rc4.857.ge22ff
Previous: Junio C Hamano
Message 12 of 12 in “checkout-index needs a working tree”
  1. checkout-index needs a working treeJohannes Schindelin, Aug 4, 2007
  2. Junio C HamanoAug 4, 2007
  3. Johannes SchindelinAug 5, 2007
  4. Uwe Kleine-KönigAug 9, 2007
  5. Johannes SchindelinAug 10, 2007
  6. Junio C HamanoAug 10, 2007
  7. Johannes SchindelinAug 10, 2007
  8. Reinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is unsetJunio C Hamano, Aug 10, 2007
  9. Uwe Kleine-KönigAug 10, 2007
  10. Junio C HamanoAug 10, 2007
  11. Junio C HamanoAug 11, 2007
  12. checkout-index doc: use --work-dir in the export exampleUwe Kleine-König, Aug 11, 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.