All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Ondrej Certik <ondrej@certik.cz>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: default aliases (ci, di, st, co)
Date: Wed, 08 Jul 2009 17:13:57 -0700 (PDT)	[thread overview]
Message-ID: <m3my7evhky.fsf@localhost.localdomain> (raw)
In-Reply-To: <85b5c3130907081649s37f726f7id1a64f2fdbe609f@mail.gmail.com>

Ondrej Certik <ondrej@certik.cz> writes:

> coming to git from mercurial and svn, here is the alias part of my
> .gitconfig:
> 
> [alias]
>     ci = commit
>     di = diff --color-words
>     st = status
>     co = checkout
> 
> 
> And all is fine until I share commands to checkout my branch (for
> example) with other people, then basically I have to write those
> commands in full (e.g. commit, checkout, ...), since I cannot assume
> they have their .gitconfig setup the same way I do. Especially for
> people who are new to git.

If you have admin rights on the machine, you can do that either using
system git config file (git config --system) i.e. $(prefix)/etc/gitconfig
or rather $(sysconfdir)/gitconfig, or by providing 'config' template
(copied as default repository config on init) in some place like
/usr/share/git-core/templates/config .

> 
> What is the view on this in the git community? Do most of you write
> 
> git checkout -b branch ...
> 
> (possibly with TAB completion) or do most of you write
> 
> git co -b branch ...
> 
> (like I do all the time, except when sharing my commands with other
> people)?

I use tab completion for commands like "git commit", "git show", "git
checkout" etc. (most important part is branch completion, not command
completion IMVHO).

But I do have few aliases:

[alias]
        cat  =    cat-file -p
        less = -p cat-file -p
        alias = config --get-regexp ^alias\\.
        lg = log --pretty=oneline --abbrev-commit
        one = show -s --pretty='format:%h (%s)'
        llog = log --date=local
        who = "!sh -c 'git log -1 --pretty=\"format:%an <%ae>\" --author=\"$1\"' -"
        lb = for-each-ref --format='%(refname)' \
             --sort=-authordate --count=8 refs/heads/
        rllog = log -g --date=relative
        rlg   = reflog show @{now}
        sed = !git ls-files --stage | grep ^100 | awk '{print $4}' | xargs sed

I use most often "git one" aliase (hmmm... I have just noticed that
"git lg" alias is now superfluous with new '--oneline' option).

> Could in principle those aliases be even made default by git? Or is
> this not a good idea.

The "default/built-in aliases" idea was discussed on git mailing list
a few times in the past...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

  reply	other threads:[~2009-07-09  0:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-08 23:49 default aliases (ci, di, st, co) Ondrej Certik
2009-07-09  0:13 ` Jakub Narebski [this message]
2009-07-09  8:58   ` Graeme Geldenhuys
2009-07-09 16:43   ` Junio C Hamano
2009-07-09 23:08     ` Paolo Bonzini
2009-07-13  6:40       ` Jeff King
2009-07-13  6:43         ` Jeff King
2009-07-13  9:15         ` Paolo Bonzini
2009-07-09  7:00 ` Andreas Ericsson
2009-07-09  8:50   ` Michael J Gruber
2009-07-09  9:04     ` Graeme Geldenhuys
2009-07-09  9:40     ` Jakub Narebski
2009-07-09  9:48       ` Michael J Gruber
2009-07-09  8:58   ` Luciano Miguel Ferreira Rocha
2009-07-12  5:07     ` Ondrej Certik
     [not found]   ` <20090709160249.GA12830@cthulhu>
2009-07-09 20:54     ` wsfix alias Andreas Ericsson
2009-07-09 21:30       ` Larry D'Anna
2009-07-09  9:01 ` default aliases (ci, di, st, co) Graeme Geldenhuys
2009-07-09  9:12   ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3my7evhky.fsf@localhost.localdomain \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ondrej@certik.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.