@@ -295,34 +295,50 @@ patterns in non-cone mode has a number of shortcomings:
295295 inconsistent.
296296
297297 * It has edge cases where the "right" behavior is unclear. Two examples:
298-
299- First, two users are in a subdirectory, and the first runs
300- git sparse-checkout set '/toplevel-dir/*.c'
301- while the second runs
302- git sparse-checkout set relative-dir
303- Should those arguments be transliterated into
304- current/subdirectory/toplevel-dir/*.c
305- and
306- current/subdirectory/relative-dir
307- before inserting into the sparse-checkout file? The user who typed
308- the first command is probably aware that arguments to set/add are
309- supposed to be patterns in non-cone mode, and probably would not be
310- happy with such a transliteration. However, many gitignore-style
311- patterns are just paths, which might be what the user who typed the
312- second command was thinking, and they'd be upset if their argument
313- wasn't transliterated.
314-
315- Second, what should bash-completion complete on for set/add commands
316- for non-cone users? If it suggests paths, is it exacerbating the
317- problem above? Also, if it suggests paths, what if the user has a
318- file or directory that begins with either a '!' or '#' or has a '*',
319- '\', '?', '[', or ']' in its name? And if it suggests paths, will
320- it complete "/pro" to "/proc" (in the root filesystem) rather than to
321- "/progress.txt" in the current directory? (Note that users are
322- likely to want to start paths with a leading '/' in non-cone mode,
323- for the same reason that .gitignore files often have one.)
324- Completing on files or directories might give nasty surprises in
325- all these cases.
298+ +
299+ First, two users are in a subdirectory, and the first runs
300+ +
301+ ----
302+ git sparse-checkout set '/toplevel-dir/*.c'
303+ ----
304+ +
305+ while the second runs
306+ +
307+ ----
308+ git sparse-checkout set relative-dir
309+ ----
310+ +
311+ Should those arguments be transliterated into
312+ +
313+ ----
314+ current/subdirectory/toplevel-dir/*.c
315+ ----
316+ +
317+ and
318+ +
319+ ----
320+ current/subdirectory/relative-dir
321+ ----
322+ +
323+ before inserting into the sparse-checkout file? The user who typed
324+ the first command is probably aware that arguments to set/add are
325+ supposed to be patterns in non-cone mode, and probably would not be
326+ happy with such a transliteration. However, many gitignore-style
327+ patterns are just paths, which might be what the user who typed the
328+ second command was thinking, and they'd be upset if their argument
329+ wasn't transliterated.
330+ +
331+ Second, what should bash-completion complete on for set/add commands
332+ for non-cone users? If it suggests paths, is it exacerbating the
333+ problem above? Also, if it suggests paths, what if the user has a
334+ file or directory that begins with either a '!' or '#' or has a '*',
335+ '\', '?', '[', or ']' in its name? And if it suggests paths, will
336+ it complete "/pro" to "/proc" (in the root filesystem) rather than to
337+ "/progress.txt" in the current directory? (Note that users are
338+ likely to want to start paths with a leading '/' in non-cone mode,
339+ for the same reason that .gitignore files often have one.)
340+ Completing on files or directories might give nasty surprises in
341+ all these cases.
326342
327343 * The excessive flexibility made other extensions essentially
328344 impractical. `--sparse-index` is likely impossible in non-cone
0 commit comments