@@ -264,34 +264,50 @@ patterns in non-cone mode has a number of shortcomings:
264264 inconsistent.
265265
266266 * It has edge cases where the "right" behavior is unclear. Two examples:
267-
268- First, two users are in a subdirectory, and the first runs
269- git sparse-checkout set '/toplevel-dir/*.c'
270- while the second runs
271- git sparse-checkout set relative-dir
272- Should those arguments be transliterated into
273- current/subdirectory/toplevel-dir/*.c
274- and
275- current/subdirectory/relative-dir
276- before inserting into the sparse-checkout file? The user who typed
277- the first command is probably aware that arguments to set/add are
278- supposed to be patterns in non-cone mode, and probably would not be
279- happy with such a transliteration. However, many gitignore-style
280- patterns are just paths, which might be what the user who typed the
281- second command was thinking, and they'd be upset if their argument
282- wasn't transliterated.
283-
284- Second, what should bash-completion complete on for set/add commands
285- for non-cone users? If it suggests paths, is it exacerbating the
286- problem above? Also, if it suggests paths, what if the user has a
287- file or directory that begins with either a '!' or '#' or has a '*',
288- '\', '?', '[', or ']' in its name? And if it suggests paths, will
289- it complete "/pro" to "/proc" (in the root filesystem) rather than to
290- "/progress.txt" in the current directory? (Note that users are
291- likely to want to start paths with a leading '/' in non-cone mode,
292- for the same reason that .gitignore files often have one.)
293- Completing on files or directories might give nasty surprises in
294- all these cases.
267+ +
268+ First, two users are in a subdirectory, and the first runs
269+ +
270+ ----
271+ git sparse-checkout set '/toplevel-dir/*.c'
272+ ----
273+ +
274+ while the second runs
275+ +
276+ ----
277+ git sparse-checkout set relative-dir
278+ ----
279+ +
280+ Should those arguments be transliterated into
281+ +
282+ ----
283+ current/subdirectory/toplevel-dir/*.c
284+ ----
285+ +
286+ and
287+ +
288+ ----
289+ current/subdirectory/relative-dir
290+ ----
291+ +
292+ before inserting into the sparse-checkout file? The user who typed
293+ the first command is probably aware that arguments to set/add are
294+ supposed to be patterns in non-cone mode, and probably would not be
295+ happy with such a transliteration. However, many gitignore-style
296+ patterns are just paths, which might be what the user who typed the
297+ second command was thinking, and they'd be upset if their argument
298+ wasn't transliterated.
299+ +
300+ Second, what should bash-completion complete on for set/add commands
301+ for non-cone users? If it suggests paths, is it exacerbating the
302+ problem above? Also, if it suggests paths, what if the user has a
303+ file or directory that begins with either a '!' or '#' or has a '*',
304+ '\', '?', '[', or ']' in its name? And if it suggests paths, will
305+ it complete "/pro" to "/proc" (in the root filesystem) rather than to
306+ "/progress.txt" in the current directory? (Note that users are
307+ likely to want to start paths with a leading '/' in non-cone mode,
308+ for the same reason that .gitignore files often have one.)
309+ Completing on files or directories might give nasty surprises in
310+ all these cases.
295311
296312 * The excessive flexibility made other extensions essentially
297313 impractical. `--sparse-index` is likely impossible in non-cone
0 commit comments