# Is it possible for git to remember the options preference for "git log"?

4 messages from 2007-11-12 to 2007-11-12. Participants: eric miao, Jakub Narebski, Daniel Barkalow.
Thread: https://gitlist.dev/t/10816

## eric miao, 2007-11-12 00:33

Subject: Is it possible for git to remember the options preference for "git log"?
Message-ID: <f17812d70711111633u6c00d182u532fef1c16c3c94a@mail.gmail.com>
URL: https://gitlist.dev/e/f17812d70711111633u6c00d182u532fef1c16c3c94a%40mail.gmail.com

```
All,

Most of the time I'm using git-log for inspecting a brief history
and insert/remove/modify commits between, which I have to
type "git log --abbrev-commit --pretty=oneline" every time. Is
it possible for git to remember this command line options
preference?

And no, I don't really want to use shell's alias or something
else, I was just used to type "git xxx" :-)

-- 
Cheers
- eric

```

## Jakub Narebski, 2007-11-12 00:56

Subject: Re: Is it possible for git to remember the options preference for "git log"?
Message-ID: <fh88av$2om$1@ger.gmane.org>
URL: https://gitlist.dev/e/fh88av%242om%241%40ger.gmane.org
In-Reply-To: <f17812d70711111633u6c00d182u532fef1c16c3c94a@mail.gmail.com>

```
eric miao wrote:


> Most of the time I'm using git-log for inspecting a brief history
> and insert/remove/modify commits between, which I have to
> type "git log --abbrev-commit --pretty=oneline" every time. Is
> it possible for git to remember this command line options
> preference?
> 
> And no, I don't really want to use shell's alias or something
> else, I was just used to type "git xxx" :-)

You can always use (global) _git_ alias ;-p

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

```

## Daniel Barkalow, 2007-11-12 01:02

Subject: Re: Is it possible for git to remember the options preference for "git log"?
Message-ID: <Pine.LNX.4.64.0711111954520.29952@iabervon.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711111954520.29952%40iabervon.org
In-Reply-To: <f17812d70711111633u6c00d182u532fef1c16c3c94a@mail.gmail.com>

```
On Mon, 12 Nov 2007, eric miao wrote:

> All,
> 
> Most of the time I'm using git-log for inspecting a brief history
> and insert/remove/modify commits between, which I have to
> type "git log --abbrev-commit --pretty=oneline" every time. Is
> it possible for git to remember this command line options
> preference?
> 
> And no, I don't really want to use shell's alias or something
> else, I was just used to type "git xxx" :-)

Git has a built-in alias mechanism, which is probably what you want. If 
you put in your config file:

[alias]
	xxx = log --abbrev-commit --pretty=online

then you can type "git xxx" and it'll do what you want. Changing the 
default behavior of the basic commands is looked down on because there are 
scripts that use them to get their input, and those scripts have 
particular formats they expect.

	-Daniel
*This .sig left intentionally blank*

```

## eric miao, 2007-11-12 02:21

Subject: Re: Is it possible for git to remember the options preference for "git log"?
Message-ID: <f17812d70711111821v2e14cf6bsd65a192114872056@mail.gmail.com>
URL: https://gitlist.dev/e/f17812d70711111821v2e14cf6bsd65a192114872056%40mail.gmail.com
In-Reply-To: <Pine.LNX.4.64.0711111954520.29952@iabervon.org>

```
On Nov 12, 2007 9:02 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
>
> On Mon, 12 Nov 2007, eric miao wrote:
>
> > All,
> >
> > Most of the time I'm using git-log for inspecting a brief history
> > and insert/remove/modify commits between, which I have to
> > type "git log --abbrev-commit --pretty=oneline" every time. Is
> > it possible for git to remember this command line options
> > preference?
> >
> > And no, I don't really want to use shell's alias or something
> > else, I was just used to type "git xxx" :-)
>
> Git has a built-in alias mechanism, which is probably what you want. If
> you put in your config file:
>
> [alias]
>         xxx = log --abbrev-commit --pretty=online
>

Thanks, this is exactly what I want.

> then you can type "git xxx" and it'll do what you want. Changing the
> default behavior of the basic commands is looked down on because there are
> scripts that use them to get their input, and those scripts have
> particular formats they expect.
>

Ye, agree, I don't think that's a good idea either.

>         -Daniel
> *This .sig left intentionally blank*
>



-- 
Cheers
- eric

```
