All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] completion: fix expansion issues with compgen
@ 2012-11-17 11:05 SZEDER Gábor
  2012-11-17 11:05 ` [PATCH 1/7] completion: make the 'basic' test more tester-friendly SZEDER Gábor
                   ` (6 more replies)
  0 siblings, 7 replies; 26+ messages in thread
From: SZEDER Gábor @ 2012-11-17 11:05 UTC (permalink / raw)
  To: git
  Cc: Felipe Contreras, Jeff King, Jonathan Nieder, Junio C Hamano,
	SZEDER Gábor

This series fixes the expansion issues with compgen reported by Jeroen
Meijer a while ago in

  http://article.gmane.org/gmane.comp.version-control.git/201596

The problem is that the compgen Bash-builtin performs expansion on all
words in the wordlist given to its -W option, breaking Git's completion
script when e.g. refs or filenames contain expandable substrings.  Since
compgen has no option to turn off this expansion and we only use a small
subset of compgen's functionality, this series replaces compgen in
__gitcomp() and __gitcomp_nl() by some shell logic and a small awk script,
respectively.

Patches 1 and 2 are test enhancements and fixes, while 3 and 4 add new
tests to make sure I don't break anything and to demonstrate the issues,
respectively.  The actual bugfixes are in patches 5 and 6.  Finally, patch
7 is a cleanup made possible by patch 6 (could be squashed into 6).

In the future we might want/need to fill COMPREPLY directly when
completing a path in the <tree>:<path> notation instead using
__gitcomp_nl() there, because paths can contain newlines, too.

Compared to Felipe's series from yesterday, this series has more tests,
more descriptive commit messages, and it's faster.  However, it doesn't
include his 1/5 (completion: get rid of empty COMPREPLY assignments).


Footnote: check the patchlist below, and notice how format-patch put
patches 4 and 5 into the same line.

SZEDER Gábor (7):
  completion: make the 'basic' test more tester-friendly
  completion: fix args of run_completion() test helper
  completion: add tests for the __gitcomp_nl() completion helper
    function
  completion: add tests for invalid variable name among completion words  completion: fix expansion issues in __gitcomp_nl()
  completion: fix expansion issue in __gitcomp()
  completion: remove the now unused __gitcomp_1() internal helper
    function

 contrib/completion/git-completion.bash |  57 ++++++++-------
 t/t9902-completion.sh                  | 123 ++++++++++++++++++++++++++++++---
 2 files changed, 147 insertions(+), 33 deletions(-)

-- 
1.8.0.220.g4d14ece

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-11-18  9:39 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 11:05 [PATCH 0/7] completion: fix expansion issues with compgen SZEDER Gábor
2012-11-17 11:05 ` [PATCH 1/7] completion: make the 'basic' test more tester-friendly SZEDER Gábor
2012-11-17 23:00   ` Jonathan Nieder
2012-11-18  9:38     ` Felipe Contreras
2012-11-18  9:39   ` Felipe Contreras
2012-11-17 11:05 ` [PATCH 2/7] completion: fix args of run_completion() test helper SZEDER Gábor
2012-11-17 23:02   ` Jonathan Nieder
2012-11-18  8:48   ` Felipe Contreras
2012-11-17 11:05 ` [PATCH 3/7] completion: add tests for the __gitcomp_nl() completion helper function SZEDER Gábor
2012-11-17 23:31   ` Jonathan Nieder
2012-11-18  8:53   ` Felipe Contreras
2012-11-17 11:05 ` [PATCH 4/7] completion: add tests for invalid variable name among completion words SZEDER Gábor
2012-11-17 23:40   ` Jonathan Nieder
2012-11-18  8:34     ` Felipe Contreras
2012-11-18  8:34   ` Felipe Contreras
2012-11-17 11:05 ` [PATCH 5/7] completion: fix expansion issues in __gitcomp_nl() SZEDER Gábor
2012-11-17 11:50   ` Felipe Contreras
2012-11-17 14:14     ` SZEDER Gábor
2012-11-17 19:08       ` Felipe Contreras
2012-11-17 19:28         ` Felipe Contreras
2012-11-18  0:55           ` Felipe Contreras
2012-11-18  0:58   ` Felipe Contreras
2012-11-17 11:05 ` [PATCH 6/7] completion: fix expansion issue in __gitcomp() SZEDER Gábor
2012-11-17 11:39   ` Felipe Contreras
2012-11-17 14:09     ` SZEDER Gábor
2012-11-17 11:05 ` [PATCH 7/7] completion: remove the now unused __gitcomp_1() internal helper function SZEDER Gábor

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.