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

Re: [PATCH 1/1] contrib/git-jump/git-jump: support alias expansion

From
Taylor Blau <me@ttaylorr.com>
Date
Sep 4, 2019, 20:51 UTC
Message-ID
<20190904205116.GA20056@syl.local>
In-Reply-To
<473a7c7b241ad2d449d3bcb6daeb77a179c7e45f.1567619579.git.me@ttaylorr.com>
On Wed, Sep 04, 2019 at 01:55:03PM -0400, Taylor Blau wrote:
Show 9 quoted lines
> @@ -68,7 +70,7 @@ if test $# -lt 1; then
>  	usage >&2
>  	exit 1
>  fi
> -mode=$1; shift
> +mode="$(git config --default "$1" --get -- "alias.$1")"; shift
>
>  trap 'rm -f "$tmp"' 0 1 2 3 15
>  tmp=`mktemp -t git-jump.XXXXXX` || exit 1

I guess it's worth noting that this does _not_ respect extra options given to the various modes. For example, if I alias 'diff' to 'diff --minimal', we will try and invoke the function "mode_diff --minimal", which doesn't make sense.

Perhaps we could take the output of this through "| awk '{ print $1 }'" to discard any extra options, but it feels like a bit of a hack.

Personally, I'm not bothered by this, but I also don't use aliases to add "default" options to any git sub-commands. But, I don't know if other people do, in which case they may want to chime in here.

Thanks in advance for your thoughts.
> --
> 2.22.0

Thanks, Taylor

Previous: Taylor BlauNext: Jeff King
Message 3 of 4 in “contrib/git-jump: support alias expansion”
  1. 0/1 contrib/git-jump: support alias expansionTaylor Blau, Sep 4, 2019
  2. 1/1 contrib/git-jump/git-jump: support alias expansionTaylor Blau, Sep 4, 2019
  3. Taylor BlauSep 4, 2019
  4. Jeff KingSep 5, 2019

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.