aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-sparse-checkout.adoc
diff options
context:
space:
mode:
authorKristoffer Haugsbakk <code@khaugsbakk.name>2025-10-08 13:48:46 +0200
committerJunio C Hamano <gitster@pobox.com>2025-10-10 07:56:09 -0700
commitb3ac6e737db8635aaed0c355ebaf291b63fb0461 (patch)
tree375d37c779eb9fb067d7d617660ef016b26f1261 /Documentation/git-sparse-checkout.adoc
parentGit 2.51 (diff)
downloadgit-b3ac6e737db8635aaed0c355ebaf291b63fb0461.tar.gz
git-b3ac6e737db8635aaed0c355ebaf291b63fb0461.zip
doc: fix accidental literal blocks
Make sure that normal paragraphs in most user-facing docs[1] don’t use literal blocks. This can easily happen if you try to maintain indentation in order to continue a block; that might work in e.g. Markdown variants, but not in AsciiDoc. The fixes are straightforward, i.e. just deindent the block and maybe add line continuations. The only exception is git-sparse-checkout(1) where we also replace indentation used for *intended* literal blocks with `----`. † 1: These have not been considered: • `Documentation/howto/` • `Documentation/technical/` • `Documentation/gitprotocol*` Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r--Documentation/git-sparse-checkout.adoc72
1 files changed, 44 insertions, 28 deletions
diff --git a/Documentation/git-sparse-checkout.adoc b/Documentation/git-sparse-checkout.adoc
index 529a8edd9c..b5fe5da041 100644
--- a/Documentation/git-sparse-checkout.adoc
+++ b/Documentation/git-sparse-checkout.adoc
@@ -264,34 +264,50 @@ patterns in non-cone mode has a number of shortcomings:
inconsistent.
* It has edge cases where the "right" behavior is unclear. Two examples:
-
- First, two users are in a subdirectory, and the first runs
- git sparse-checkout set '/toplevel-dir/*.c'
- while the second runs
- git sparse-checkout set relative-dir
- Should those arguments be transliterated into
- current/subdirectory/toplevel-dir/*.c
- and
- current/subdirectory/relative-dir
- before inserting into the sparse-checkout file? The user who typed
- the first command is probably aware that arguments to set/add are
- supposed to be patterns in non-cone mode, and probably would not be
- happy with such a transliteration. However, many gitignore-style
- patterns are just paths, which might be what the user who typed the
- second command was thinking, and they'd be upset if their argument
- wasn't transliterated.
-
- Second, what should bash-completion complete on for set/add commands
- for non-cone users? If it suggests paths, is it exacerbating the
- problem above? Also, if it suggests paths, what if the user has a
- file or directory that begins with either a '!' or '#' or has a '*',
- '\', '?', '[', or ']' in its name? And if it suggests paths, will
- it complete "/pro" to "/proc" (in the root filesystem) rather than to
- "/progress.txt" in the current directory? (Note that users are
- likely to want to start paths with a leading '/' in non-cone mode,
- for the same reason that .gitignore files often have one.)
- Completing on files or directories might give nasty surprises in
- all these cases.
++
+First, two users are in a subdirectory, and the first runs
++
+----
+git sparse-checkout set '/toplevel-dir/*.c'
+----
++
+while the second runs
++
+----
+git sparse-checkout set relative-dir
+----
++
+Should those arguments be transliterated into
++
+----
+current/subdirectory/toplevel-dir/*.c
+----
++
+and
++
+----
+current/subdirectory/relative-dir
+----
++
+before inserting into the sparse-checkout file? The user who typed
+the first command is probably aware that arguments to set/add are
+supposed to be patterns in non-cone mode, and probably would not be
+happy with such a transliteration. However, many gitignore-style
+patterns are just paths, which might be what the user who typed the
+second command was thinking, and they'd be upset if their argument
+wasn't transliterated.
++
+Second, what should bash-completion complete on for set/add commands
+for non-cone users? If it suggests paths, is it exacerbating the
+problem above? Also, if it suggests paths, what if the user has a
+file or directory that begins with either a '!' or '#' or has a '*',
+'\', '?', '[', or ']' in its name? And if it suggests paths, will
+it complete "/pro" to "/proc" (in the root filesystem) rather than to
+"/progress.txt" in the current directory? (Note that users are
+likely to want to start paths with a leading '/' in non-cone mode,
+for the same reason that .gitignore files often have one.)
+Completing on files or directories might give nasty surprises in
+all these cases.
* The excessive flexibility made other extensions essentially
impractical. `--sparse-index` is likely impossible in non-cone