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

Re: [PATCH v3] gitk: add -C <path> commandline parameter to change path

From
Paul Mackerras <paulus@ozlabs.org>
Date
Dec 19, 2015, 03:13 UTC
Message-ID
<20151219031332.GE422@fergus.ozlabs.ibm.com>
In-Reply-To
<1447069522-19895-1-git-send-email-juhapekka.heikkila@gmail.com>
On Mon, Nov 09, 2015 at 01:45:22PM +0200, Juha-Pekka Heikkila wrote:
Show 6 quoted lines
> This patch adds -C (change working directory) parameter to
> gitk. With this parameter, instead of need to cd to directory
> with .git folder, one can point the correct folder from
> commandline.
> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Thanks.

While I like the idea, there are a couple of minor problems with the patch. First, the Documentation directory is in Junio's tree, not mine, so the change to gitk and the change to Documentation need to be separated. Secondly, please use 4-space indentation rather than 8-space for consistency with the rest of the file. See also the comments below.

> +	"-C*" {
> +		if {[string length $arg] < 3} {
> +			incr i
> +			set cwd_path [lindex $argv [expr {$i}]]
No need to say [expr {$i}] here; [lindex $argv $i] works just fine.

Also, if i is now >= [llength $argv], we'll get an empty string in cwd_path. Is that what you meant? Shouldn't we display an appropriate error message instead of trying to cd to ""?

Paul.
Previous: Juha-Pekka Heikkila
Message 8 of 8 in “gitk: add --cwd=path commandline parameter to change path”
  1. 0/1 gitk: add --cwd=path commandline parameter to change pathJuha-Pekka Heikkila, Nov 3, 2015
  2. 1/1 gitk: add --cwd=path commandline parameter to change pathJuha-Pekka Heikkila, Nov 3, 2015
  3. Eric SunshineNov 3, 2015
  4. gitk: add -C <path> commandline parameter to change pathJuha-Pekka Heikkila, Nov 5, 2015
  5. Eric SunshineNov 6, 2015
  6. Juha-Pekka HeikkilaNov 6, 2015
  7. gitk: add -C <path> commandline parameter to change pathJuha-Pekka Heikkila, Nov 9, 2015
  8. Paul MackerrasDec 19, 2015

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.