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

Re: git log alias with --all and --exclude

From
RKRene Kita <mail@rkta.de>
Date
Sep 5, 2024, 05:23 UTC
Message-ID
<20240905052310.GC15670@t480>
In-Reply-To
<xmqqjzfr87wh.fsf@gitster.g>
On Wed, Sep 04, 2024 at 01:45:50PM -0700, Junio C Hamano wrote:
Show 21 quoted lines
> Jacob Keller <jacob.keller@gmail.com> writes:
> 
> >> > > 'gr = log --oneline --abbrev-commit --all --graph --decorate --color'
> >
> > You could implement this as a shell alias so that your options get
> > included before the --all. I'm not sure how trivial that would be to
> > do, but thats how I would go about implementing this alias.
> 
> True.  If I were doing this, I would at least do something like
> 
>     [alias]
> 	rg = "!sh -c 'git log --oneline --abbrev-commit --graph \
> 		--decorate --color ${1-\"--all\"} \"$@\"' -"
> 
> so that
> 
>  (1) "git rg" without any argument will default to "--all"
>  (2) "git rg --exclude 'wip*' --branches" would work as expected,
>      just like "git rg --first-parent master..seen" would.
> 
> Thanks.
Thanks for the ideas, I will adjust my alias.
Previous: Junio C Hamano
Message 6 of 6 in “git log alias with --all and --exclude”
  1. Rene KitaSep 4, 2024
  2. Johannes SixtSep 4, 2024
  3. Rene KitaSep 4, 2024
  4. Jacob KellerSep 4, 2024
  5. Junio C HamanoSep 4, 2024
  6. Rene KitaSep 5, 2024

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.