Message ID | pull.1108.v6.git.1643945198.gitgitgadget@gmail.com (mailing list archive) |
---|---|
Headers | show |
Series | completion: sparse-checkout updates | expand |
Hi, On Thu, Feb 3, 2022 at 7:26 PM Lessley Dennington via GitGitGadget <gitgitgadget@gmail.com> wrote: > > This change updates custom tab completion for the sparse-checkout command. > Specifically, it corrects the following issues with the current method: > > 1. git sparse-checkout <TAB> results in an incomplete list of subcommands > (it is missing reapply and add). > 2. Options for subcommands are not tab-completable. > 3. git sparse-checkout set <TAB> and git sparse-checkout add <TAB> show > both file names and directory names. While this may be a less surprising > behavior for non-cone mode, we want to only show directories in cone > mode. > > The first commit in this series is an intermediate step that fixes issues 1 > and 2 above and introduces a simple fix for issue 3 with some performance > and unusual character-related caveats. The next commit adds a new > __gitcomp_directories method that fixes the performance-related caveat from > the first commit by completing just a single level of directories. The final > commit modifies __gitcomp_directories to handle unusual characters in > directory names. > > > Changes since V5 > ================ > > * Fix incorrect conditional that was causing failure of non-cone mode test > (and causing 'seen' CI to fail). > * Remove __git_comp_directories indentation changes between the second and > third commits. This round looks good to me: Reviewed-by: Elijah Newren <newren@gmail.com> Nice work!
Elijah Newren <newren@gmail.com> writes: >> Changes since V5 >> ================ >> >> * Fix incorrect conditional that was causing failure of non-cone mode test >> (and causing 'seen' CI to fail). >> * Remove __git_comp_directories indentation changes between the second and >> third commits. > > This round looks good to me: > > Reviewed-by: Elijah Newren <newren@gmail.com> > > Nice work! Thanks, both. Will queue. Let's mark it to be merged down to 'next' soonish.
On Fri, Feb 4, 2022 at 9:04 AM Junio C Hamano <gitster@pobox.com> wrote: > > Elijah Newren <newren@gmail.com> writes: > > >> Changes since V5 > >> ================ > >> > >> * Fix incorrect conditional that was causing failure of non-cone mode test > >> (and causing 'seen' CI to fail). > >> * Remove __git_comp_directories indentation changes between the second and > >> third commits. > > > > This round looks good to me: > > > > Reviewed-by: Elijah Newren <newren@gmail.com> > > > > Nice work! > > Thanks, both. Will queue. Let's mark it to be merged down to > 'next' soonish. Ævar had a good comment about code coverage on Windows that we might want to address first[1]. (Namely, splitting one test into two -- one that tests a path with backslashes that can be skipped on windows, and a separate test that checks paths with spaces, tabs, and non-ascii that can be run on all platforms.) But other than that, yeah, this should be ready for 'next'. [1] https://lore.kernel.org/git/220204.86h79f45nf.gmgdl@evledraar.gmail.com/
Elijah Newren <newren@gmail.com> writes: > Ævar had a good comment about code coverage on Windows that we might > want to address first[1]. (Namely, splitting one test into two -- one > that tests a path with backslashes that can be skipped on windows, and > a separate test that checks paths with spaces, tabs, and non-ascii > that can be run on all platforms.) According to the lazy-prereq definition for FUNNYNAMES, we seem to skip tab-embedded names on windows, so it may not be used on all platforms, but such a detail aside... I do not get why funny letters should matter and need to be tested specially in the first place, to be honest, but because we have with FUNNYNAMES prereq already, hiding some tests behind it would be a good idea regardless. > But other than that, yeah, this should be ready for 'next'. > > [1] https://lore.kernel.org/git/220204.86h79f45nf.gmgdl@evledraar.gmail.com/ Thanks.
On Fri, Feb 4, 2022 at 11:54 AM Junio C Hamano <gitster@pobox.com> wrote: > > Elijah Newren <newren@gmail.com> writes: > > > Ævar had a good comment about code coverage on Windows that we might > > want to address first[1]. (Namely, splitting one test into two -- one > > that tests a path with backslashes that can be skipped on windows, and > > a separate test that checks paths with spaces, tabs, and non-ascii > > that can be run on all platforms.) > > According to the lazy-prereq definition for FUNNYNAMES, we seem to > skip tab-embedded names on windows, so it may not be used on all > platforms, but such a detail aside... > > I do not get why funny letters should matter and need to be tested > specially in the first place, to be honest, but because we have with > FUNNYNAMES prereq already, hiding some tests behind it would be a > good idea regardless. Earlier versions of the patch series failed to handle paths that contained various special characters; see the second comment at https://lore.kernel.org/git/CABPp-BEq9pTqsy_R_SR1DSgUK58ubNR1Gk4G1RoL8wkadyo6zw@mail.gmail.com/. Handling them was specifically the job of the third patch in the series, and thus it made sense to add some kind of test for them.
Elijah Newren <newren@gmail.com> writes: > Handling them was specifically the job of the third patch in the > series, and thus it made sense to add some kind of test for them. Ah, yeah, reading from ls-tree via process substitution to avoid a pipe that makes the loop a subshell and using "read -d$'\0'" with IFS disabled to grok the -z output. Full of bash-isms of the good kind ;-). Nicely done, and it deserves to be showed off in tests.