git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2/RFC] Make git-completion Bash 4 compatible.

From
Brian Gernhardt <brian@gernhardtsoftware.com>
Date
Oct 27, 2010, 17:23 UTC
Message-ID
<091B05F5-D5F4-4DD6-90AF-E0BD77700326@gernhardtsoftware.com>
In-Reply-To
<20101027131506.4da06c6d@MonteCarlo>
On Oct 27, 2010, at 1:15 PM, Peter van der Does wrote:
> contrib/completion/git-completion.bash |  417 +++++++++++++++++++++++++++-----
> 1 files changed, 355 insertions(+), 62 deletions(-)
That's a lot of added lines?  Do we use all of this code?  If not, should we trim it down just to support the features we need?
Also, there appears to be no note in the code or commit message that this came from somewhere else.  Shouldn't we note the source of the code?  Is bash-completion GPLv2 as we are?
> +	_upvar() {
> +		if unset -v "$1"; then           # Unset & validate varname
Nit: This should be indented one less level.
Show 8 quoted lines
> +	        if (( $# == 2 )); then
> +	            eval $1=\"\$2\"          # Return single value
> +	        else
> +	            eval $1=\(\"\${@:2}\"\)  # Return array
> +	        fi
> +	    fi
> +	}
> +
Other than those concerns, I like it.  Good call not trying to redefine the functions from bash-completion if it's loaded already.
~~ Brian
Previous: Peter van der DoesNext: Jonathan Nieder
Message 2 of 11 in “Make git-completion Bash 4 compatible.”
  1. Make git-completion Bash 4 compatible.Peter van der Does, Oct 27, 2010
  2. Brian GernhardtOct 27, 2010
  3. Jonathan NiederOct 27, 2010
  4. SZEDER GáborOct 27, 2010
  5. Peter van der DoesOct 28, 2010
  6. Jonathan NiederOct 28, 2010
  7. Peter van der DoesOct 28, 2010
  8. Jakub NarebskiOct 28, 2010
  9. Peter van der DoesOct 28, 2010
  10. SZEDER GáborOct 27, 2010
  11. Jonathan NiederOct 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.