threads / discuss / 10816

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

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

## tl;dr

4 messages between Nov 12, 2007 and Nov 12, 2007.

replies: 3people: 3as markdown or json

eric miao· Nov 12, 2007, 00:33 UTC · lore
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· Nov 12, 2007, 00:56 UTC · re: eric miao · lore

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

eric miao wrote:
Show 8 quoted lines
> 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· Nov 12, 2007, 01:02 UTC · re: eric miao · lore

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

On Mon, 12 Nov 2007, eric miao wrote:
Show 10 quoted lines
> 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· Nov 12, 2007, 02:21 UTC · re: Daniel Barkalow · lore

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

On Nov 12, 2007 9:02 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 20 quoted lines
>
> 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.
Show 5 quoted lines
> 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

← back to recent threads