{"thread":{"id":"20060","subject":"default aliases (ci, di, st, co)","startedAt":"2009-07-08T23:49:26Z","lastAt":"2009-07-13T09:15:12Z","messageCount":19,"participants":["Ondrej Certik","Jakub Narebski","Andreas Ericsson","Michael J Gruber","Luciano Miguel Ferreira Rocha","Graeme Geldenhuys","Matthieu Moy","Junio C Hamano","Larry D'Anna","Paolo Bonzini","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"117641","messageId":"85b5c3130907081649s37f726f7id1a64f2fdbe609f@mail.gmail.com","threadId":"20060","inReplyTo":null,"subject":"default aliases (ci, di, st, co)","fromName":"Ondrej Certik","fromEmail":"ondrej@certik.cz","sentAt":"2009-07-08T23:49:26Z","receivedAt":"2009-07-08T23:49:26Z","isPatch":false,"sender":{"key":"ondrej@certik.cz","avatar":"https://gravatar.com/avatar/106d05822138a98292e09d1580dbe8f27e05faecd87f13d5d58d889d0687771c?d=mp&s=160"},"body":"Hi,\n\ncoming to git from mercurial and svn, here is the alias part of my .gitconfig:\n\n[alias]\n    ci = commit\n    di = diff --color-words\n    st = status\n    co = checkout\n\n\nAnd all is fine until I share commands to checkout my branch (for\nexample) with other people, then basically I have to write those\ncommands in full (e.g. commit, checkout, ...), since I cannot assume\nthey have their .gitconfig setup the same way I do. Especially for\npeople who are new to git.\n\nWhat is the view on this in the git community? Do most of you write\n\ngit checkout -b branch ...\n\n(possibly with TAB completion) or do most of you write\n\ngit co -b branch ...\n\n(like I do all the time, except when sharing my commands with other people)?\n\nCould in principle those aliases be even made default by git? Or is\nthis not a good idea.\n\nOndrej\n"},{"id":"117643","messageId":"m3my7evhky.fsf@localhost.localdomain","threadId":"20060","inReplyTo":"85b5c3130907081649s37f726f7id1a64f2fdbe609f@mail.gmail.com","subject":"Re: default aliases (ci, di, st, co)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-07-09T00:13:57Z","receivedAt":"2009-07-09T00:13:57Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ondrej Certik <ondrej@certik.cz> writes:\n\n> coming to git from mercurial and svn, here is the alias part of my\n> .gitconfig:\n> \n> [alias]\n>     ci = commit\n>     di = diff --color-words\n>     st = status\n>     co = checkout\n> \n> \n> And all is fine until I share commands to checkout my branch (for\n> example) with other people, then basically I have to write those\n> commands in full (e.g. commit, checkout, ...), since I cannot assume\n> they have their .gitconfig setup the same way I do. Especially for\n> people who are new to git.\n\nIf you have admin rights on the machine, you can do that either using\nsystem git config file (git config --system) i.e. $(prefix)/etc/gitconfig\nor rather $(sysconfdir)/gitconfig, or by providing 'config' template\n(copied as default repository config on init) in some place like\n/usr/share/git-core/templates/config .\n\n> \n> What is the view on this in the git community? Do most of you write\n> \n> git checkout -b branch ...\n> \n> (possibly with TAB completion) or do most of you write\n> \n> git co -b branch ...\n> \n> (like I do all the time, except when sharing my commands with other\n> people)?\n\nI use tab completion for commands like \"git commit\", \"git show\", \"git\ncheckout\" etc. (most important part is branch completion, not command\ncompletion IMVHO).\n\nBut I do have few aliases:\n\n[alias]\n        cat  =    cat-file -p\n        less = -p cat-file -p\n        alias = config --get-regexp ^alias\\\\.\n        lg = log --pretty=oneline --abbrev-commit\n        one = show -s --pretty='format:%h (%s)'\n        llog = log --date=local\n        who = \"!sh -c 'git log -1 --pretty=\\\"format:%an <%ae>\\\" --author=\\\"$1\\\"' -\"\n        lb = for-each-ref --format='%(refname)' \\\n             --sort=-authordate --count=8 refs/heads/\n        rllog = log -g --date=relative\n        rlg   = reflog show @{now}\n        sed = !git ls-files --stage | grep ^100 | awk '{print $4}' | xargs sed\n\nI use most often \"git one\" aliase (hmmm... I have just noticed that\n\"git lg\" alias is now superfluous with new '--oneline' option).\n\n> Could in principle those aliases be even made default by git? Or is\n> this not a good idea.\n\nThe \"default/built-in aliases\" idea was discussed on git mailing list\na few times in the past...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"117652","messageId":"4A55958E.1050401@op5.se","threadId":"20060","inReplyTo":"85b5c3130907081649s37f726f7id1a64f2fdbe609f@mail.gmail.com","subject":"Re: default aliases (ci, di, st, co)","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-07-09T07:00:30Z","receivedAt":"2009-07-09T07:00:30Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Ondrej Certik wrote:\n> Hi,\n> \n> coming to git from mercurial and svn, here is the alias part of my .gitconfig:\n> \n> [alias]\n>     ci = commit\n>     di = diff --color-words\n>     st = status\n>     co = checkout\n> \n> \n> And all is fine until I share commands to checkout my branch (for\n> example) with other people, then basically I have to write those\n> commands in full (e.g. commit, checkout, ...), since I cannot assume\n> they have their .gitconfig setup the same way I do. Especially for\n> people who are new to git.\n> \n> What is the view on this in the git community?\n\n\nPersonally I think \"plain\" aliases like you use above are evil.\ngit is not svn or mercurial. If you use it like svn you'll be\nsurprised sooner or later and your workflow will feel awkward or\njust plain wrong. hg and git are very similar, but the fact that\nhg assumed the svn shorthands implies to me that they've tried\nto retain a compatibility that does not, in fact, exist. DVCS\nsystems are enormously different from centralized ones. Borrowing\nfrom centralized ones to a DVCS one feels utterly backwards.\n\n\n> Do most of you write\n> \n> git checkout -b branch ...\n> \n> (possibly with TAB completion) or do most of you write\n> \n> git co -b branch ...\n> \n> (like I do all the time, except when sharing my commands with other people)?\n> \n\nI have no simple aliases for any of the commands. There's just no reason\nfor them since tab completion works so well.\n\nI do have one alias, which is \"wsfix\". It fixes whitespace fsckups I've\nadded to the index but not yet committed to the worktree. It's not a\nparticularly complex one, but not exactly simple either.\n\n\n> Could in principle those aliases be even made default by git? Or is\n> this not a good idea.\n> \n\nI see no reason to add default aliases. It will make a mess of things\nwhen trying to explain workflows to people who have older versions of\ngit where those default aliases aren't available. It'll add complexity\nto explanations, which is never a good thing.\n\nIf I have a vote, I vote no.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"117665","messageId":"4A55AF45.4040700@drmicha.warpmail.net","threadId":"20060","inReplyTo":"4A55958E.1050401@op5.se","subject":"Re: default aliases (ci, di, st, co)","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-09T08:50:13Z","receivedAt":"2009-07-09T08:50:13Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Andreas Ericsson venit, vidit, dixit 09.07.2009 09:00:\n> Ondrej Certik wrote:\n>> Hi,\n>>\n>> coming to git from mercurial and svn, here is the alias part of my .gitconfig:\n>>\n>> [alias]\n>>     ci = commit\n>>     di = diff --color-words\n>>     st = status\n>>     co = checkout\n>>\n>>\n>> And all is fine until I share commands to checkout my branch (for\n>> example) with other people, then basically I have to write those\n>> commands in full (e.g. commit, checkout, ...), since I cannot assume\n>> they have their .gitconfig setup the same way I do. Especially for\n>> people who are new to git.\n>>\n>> What is the view on this in the git community?\n> \n> \n> Personally I think \"plain\" aliases like you use above are evil.\n> git is not svn or mercurial. If you use it like svn you'll be\n> surprised sooner or later and your workflow will feel awkward or\n> just plain wrong. hg and git are very similar, but the fact that\n> hg assumed the svn shorthands implies to me that they've tried\n> to retain a compatibility that does not, in fact, exist. DVCS\n> systems are enormously different from centralized ones. Borrowing\n> from centralized ones to a DVCS one feels utterly backwards.\n> \n> \n>> Do most of you write\n>>\n>> git checkout -b branch ...\n>>\n>> (possibly with TAB completion) or do most of you write\n>>\n>> git co -b branch ...\n>>\n>> (like I do all the time, except when sharing my commands with other people)?\n>>\n> \n> I have no simple aliases for any of the commands. There's just no reason\n> for them since tab completion works so well.\n> \n> I do have one alias, which is \"wsfix\". It fixes whitespace fsckups I've\n> added to the index but not yet committed to the worktree. It's not a\n> particularly complex one, but not exactly simple either.\n> \n> \n>> Could in principle those aliases be even made default by git? Or is\n>> this not a good idea.\n>>\n> \n> I see no reason to add default aliases. It will make a mess of things\n> when trying to explain workflows to people who have older versions of\n> git where those default aliases aren't available. It'll add complexity\n> to explanations, which is never a good thing.\n> \n> If I have a vote, I vote no.\n> \n\nAdding my no-vote to that, too.\n\nAliases are great, but default aliases are a problem. We saw this when\nwe introduced \"git stage\", and I don't think we're happy in retrorespect.\n\nHaving said that, collecting useful aliases (e.g. one, who, ...) in\ncontrib/ or in the wiki would be helpful.\n\nMichael\n"},{"id":"117670","messageId":"h34bgf$7s4$1@ger.gmane.org","threadId":"20060","inReplyTo":"m3my7evhky.fsf@localhost.localdomain","subject":"Re: default aliases (ci, di, st, co)","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-09T08:58:31Z","receivedAt":"2009-07-09T08:58:31Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Jakub Narebski wrote:\n>         one = show -s --pretty='format:%h (%s)'\n\nI like that one. It's going to be very handy for when I post commit \nmessages to my project newsgroup, as a subject title.\n\n\n> I use most often \"git one\" aliase (hmmm... I have just noticed that\n> \"git lg\" alias is now superfluous with new '--oneline' option).\n\n:-)  I only learned about --oneline yesterday myself and was going to \nmention that to you. You beat me to it.\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"117669","messageId":"20090709085837.GA12348@bit.office.eurotux.com","threadId":"20060","inReplyTo":"4A55958E.1050401@op5.se","subject":"Re: default aliases (ci, di, st, co)","fromName":"Luciano Miguel Ferreira Rocha","fromEmail":"luciano@eurotux.com","sentAt":"2009-07-09T08:58:37Z","receivedAt":"2009-07-09T08:58:37Z","isPatch":false,"sender":{"key":"luciano@eurotux.com","avatar":null},"body":"On Thu, Jul 09, 2009 at 09:00:30AM +0200, Andreas Ericsson wrote:\n>  Ondrej Certik wrote:\n> > Hi,\n> > coming to git from mercurial and svn, here is the alias part of my \n> > .gitconfig:\n> > [alias]\n> >     ci = commit\n> >     di = diff --color-words\n> >     st = status\n> >     co = checkout\n> > And all is fine until I share commands to checkout my branch (for\n> > example) with other people, then basically I have to write those\n> > commands in full (e.g. commit, checkout, ...), since I cannot assume\n> > they have their .gitconfig setup the same way I do. Especially for\n> > people who are new to git.\n> > What is the view on this in the git community?\n> \n> \n>  Personally I think \"plain\" aliases like you use above are evil.\n>  git is not svn or mercurial. If you use it like svn you'll be\n>  surprised sooner or later and your workflow will feel awkward or\n>  just plain wrong. hg and git are very similar, but the fact that\n>  hg assumed the svn shorthands implies to me that they've tried\n>  to retain a compatibility that does not, in fact, exist.\n\nNo, it just means that shorting common commands is useful and common.\n\n>  I have no simple aliases for any of the commands. There's just no reason\n>  for them since tab completion works so well.\n\n\"Intelligent\" bash completion always gets in my way, so I can't use it.\n\nI vote yes.\n\n-- \nLuciano Rocha <luciano@eurotux.com>\nEurotux Informática, S.A. <http://www.eurotux.com/>\n"},{"id":"117671","messageId":"h34bms$8to$1@ger.gmane.org","threadId":"20060","inReplyTo":"85b5c3130907081649s37f726f7id1a64f2fdbe609f@mail.gmail.com","subject":"Re: default aliases (ci, di, st, co)","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-09T09:01:55Z","receivedAt":"2009-07-09T09:01:55Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Ondrej Certik wrote:\n> [alias]\n>     ci = commit\n>     di = diff --color-words\n>     st = status\n>     co = checkout\n> \n\nI also gave from SVN and I must admit, I did create co, st, ci aliases, \nbut basically never used them, so removed them since. Git is not SVN, so \nwhy treat it as such.\n\nAlternatively, you can put your alias somewhere on a wiki or personal \nweb page and just refer user to look at your alias list, instead of \nhaving to explain to them every time why your git commands are \nnon-standard. It might save you some time and effort - in the long run.\n\nOr just learn the full git commands. ;-)\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"117673","messageId":"h34br8$8to$2@ger.gmane.org","threadId":"20060","inReplyTo":"4A55AF45.4040700@drmicha.warpmail.net","subject":"Re: default aliases (ci, di, st, co)","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-09T09:04:17Z","receivedAt":"2009-07-09T09:04:17Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Michael J Gruber wrote:\n> \n> Having said that, collecting useful aliases (e.g. one, who, ...) in\n> contrib/ or in the wiki would be helpful.\n\n+1 to that. I only spotted the 'one' alias now. So simple yet very \nhandy. :-)\n\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"117674","messageId":"vpqy6qycj9l.fsf@bauges.imag.fr","threadId":"20060","inReplyTo":"h34bms$8to$1@ger.gmane.org","subject":"Re: default aliases (ci, di, st, co)","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2009-07-09T09:12:22Z","receivedAt":"2009-07-09T09:12:22Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Graeme Geldenhuys <graemeg@gmail.com> writes:\n\n> Ondrej Certik wrote:\n>> [alias]\n>>     ci = commit\n>>     di = diff --color-words\n>>     st = status\n>>     co = checkout\n>>\n>\n> I also gave from SVN and I must admit, I did create co, st, ci\n> aliases, but basically never used them, so removed them since. Git is\n> not SVN, so why treat it as such.\n\nco is indeed particularly nasty. Yes, it's common for cvs/svn\nold-timers, but \"co\" is a prefix of \"COmmit\", and means \"CheckOut\".\nThat's really misleading.\n\nAnd the problem with aliases is that although they are good for\npersonnal use, they become bad when people use them publicly : either\nin mail messages or in scripts. Ask about something that requires \"git\ncommit\" on the Git mailing list, everybody will be talking about \"git\ncommit\", not one about \"git ci\", the other about \"git checkin\" and the\nlast one about \"git commit\". That's far less misleading (yes, the\nexample is oversimplified, but if I advise someone to use \"git diff\n--color-words\", he/she understands what I'm talking about immediately,\nwhile if I advise \"git di\", it requires more time).\n\nOne thing I'd like to see is a wizard that creates a ~/.gitconfig with\nthis section commented out when it does not exist, like\n\n[alias]\n# Aliases, uncomment the lines to use them.\n# ci = commit\n# di = diff --color-words\n\nTo reduce the effort of people willing to use aliases, without making\nthem totally official.\n\n-- \nMatthieu\n"},{"id":"117678","messageId":"200907091140.16651.jnareb@gmail.com","threadId":"20060","inReplyTo":"4A55AF45.4040700@drmicha.warpmail.net","subject":"Re: default aliases (ci, di, st, co)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-07-09T09:40:15Z","receivedAt":"2009-07-09T09:40:15Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Thu, 9 July 2009, Michael J Gruber wrote:\n\n[...]\n> Aliases are great, but default aliases are a problem. We saw this when\n> we introduced \"git stage\", and I don't think we're happy in\n> retrorespect. \n> \n> Having said that, collecting useful aliases (e.g. one, who, ...) in\n> contrib/ or in the wiki would be helpful.\n\nhttp://git.or.cz/gitwiki/Aliases\n\n-- \nJakub Narebski\nPoland\n"},{"id":"117679","messageId":"4A55BD07.9010907@drmicha.warpmail.net","threadId":"20060","inReplyTo":"200907091140.16651.jnareb@gmail.com","subject":"Re: default aliases (ci, di, st, co)","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-07-09T09:48:55Z","receivedAt":"2009-07-09T09:48:55Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jakub Narebski venit, vidit, dixit 09.07.2009 11:40:\n> On Thu, 9 July 2009, Michael J Gruber wrote:\n> \n> [...]\n>> Aliases are great, but default aliases are a problem. We saw this when\n>> we introduced \"git stage\", and I don't think we're happy in\n>> retrorespect. \n>>\n>> Having said that, collecting useful aliases (e.g. one, who, ...) in\n>> contrib/ or in the wiki would be helpful.\n> \n> http://git.or.cz/gitwiki/Aliases\n> \n\nThanks, I know, I added \"git serve\" a long time ago. I guess my use of\n\"would\" was quite misleading.\n\nMichael\n"},{"id":"117705","messageId":"7vskh53iyt.fsf@alter.siamese.dyndns.org","threadId":"20060","inReplyTo":"m3my7evhky.fsf@localhost.localdomain","subject":"Re: default aliases (ci, di, st, co)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-09T16:43:38Z","receivedAt":"2009-07-09T16:43:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n>         one = show -s --pretty='format:%h (%s)'\n\nIf you use \"git one\" for quoting a commit in the log message, please use a\nformat that shows the date as well (I think I posted mine to the list in\nthe past).\n"},{"id":"117724","messageId":"4A56590F.9050206@op5.se","threadId":"20060","inReplyTo":"20090709160249.GA12830@cthulhu","subject":"wsfix alias","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2009-07-09T20:54:39Z","receivedAt":"2009-07-09T20:54:39Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Larry D'Anna wrote:\n> * Andreas Ericsson (ae@op5.se) [090709 03:04]:\n>> I do have one alias, which is \"wsfix\". It fixes whitespace fsckups I've\n>> added to the index but not yet committed to the worktree. It's not a\n>> particularly complex one, but not exactly simple either.\n> \n> oooh, i can has?\n> \n>       --larry\n\nThese are quite stupid and can lose data for you. Please use with some care.\nOh, and I lied. I have two aliases. wsfixi is the one that applies staged\nstuff. wsfix fixes all whitespace errors since the last commit and stages\nall changes in the index. Again, use with care, and don't hang me if they\nbreak your day ;-)\n\nMind the wrapping if your mua does things like that.\n\n[alias]\n  wsfix = !git diff HEAD >P.diff && git reset --hard && git apply --whitespace=fix P.diff && rm -f P.diff\n  wsfixi = !git diff --cached >P.diff && git reset && git apply --whitespace=fix P.diff && rm -f P.diff\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"117729","messageId":"20090709213028.GA28293@cthulhu","threadId":"20060","inReplyTo":"4A56590F.9050206@op5.se","subject":"Re: wsfix alias","fromName":"Larry D'Anna","fromEmail":"larry@elder-gods.org","sentAt":"2009-07-09T21:30:28Z","receivedAt":"2009-07-09T21:30:28Z","isPatch":false,"sender":{"key":"larry@elder-gods.org","avatar":"https://avatars.githubusercontent.com/u/3013304?v=4"},"body":"* Andreas Ericsson (ae@op5.se) [090709 16:54]:\n> Larry D'Anna wrote:\n>> * Andreas Ericsson (ae@op5.se) [090709 03:04]:\n>>> I do have one alias, which is \"wsfix\". It fixes whitespace fsckups I've\n>>> added to the index but not yet committed to the worktree. It's not a\n>>> particularly complex one, but not exactly simple either.\n>>\n>> oooh, i can has?\n>>\n>>       --larry\n>\n> These are quite stupid and can lose data for you. Please use with some care.\n> Oh, and I lied. I have two aliases. wsfixi is the one that applies staged\n> stuff. wsfix fixes all whitespace errors since the last commit and stages\n> all changes in the index. Again, use with care, and don't hang me if they\n> break your day ;-)\n>\n> Mind the wrapping if your mua does things like that.\n>\n> [alias]\n>  wsfix = !git diff HEAD >P.diff && git reset --hard && git apply --whitespace=fix P.diff && rm -f P.diff\n>  wsfixi = !git diff --cached >P.diff && git reset && git apply --whitespace=fix P.diff && rm -f P.diff\n\na safer one: \n\nxargs -0 -I: <<'EOF' git config --file ~/.gitconfig alias.wsfix :\n!\n. \"$(git --exec-path)\"/git-sh-setup\nif git-diff --quiet --exit-code; then\n    if git diff --cached --check >/dev/null; then\n        exit 0;\n    fi\n    echo fixing\n    git diff --cached > $GIT_DIR/wsfix.diff\n    git apply -R $GIT_DIR/wsfix.diff\n    git apply --whitespace=fix $GIT_DIR/wsfix.diff\n    rm -f $GIT_DIR/wsfix.diff\nelse\n    echo wokring tree is dirty\\!\nfi\nEOF\n\n\n        --larry\n"},{"id":"117733","messageId":"4A56786B.7040904@gnu.org","threadId":"20060","inReplyTo":"7vskh53iyt.fsf@alter.siamese.dyndns.org","subject":"Re: default aliases (ci, di, st, co)","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-07-09T23:08:27Z","receivedAt":"2009-07-09T23:08:27Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 07/09/2009 06:43 PM, Junio C Hamano wrote:\n> Jakub Narebski<jnareb@gmail.com>  writes:\n>\n>>          one = show -s --pretty='format:%h (%s)'\n>\n> If you use \"git one\" for quoting a commit in the log message, please use a\n> format that shows the date as well (I think I posted mine to the list in\n> the past).\n\nYes, it's in the wiki and in my .gitconfig:\n\n         whatis = \"!sh -c 'git show -s --pretty=\\\"format:%h (%s, %ai\\\" \n\\\"$@\\\" | sed -e \\\"s/ [012][0-9]:[0-5][0-9]:[0-5][0-9] \n[-+][0-9][0-9][0-9][0-9]$/)\\\\n/\\\"' -\"\n\nBTW, the wiki shows a nice trick to avoid the extra ' quotation:\n\n         whatis = \"!f() { git show -s --pretty='format:%h (%s, %ai' \n\\\"$@\\\" | sed -e 's/ [012][0-9]:[0-5][0-9]:[0-5][0-9] \n[-+][0-9][0-9][0-9][0-9]$/)\\\\n/'; }; f\"\n\n\nPaolo\n"},{"id":"117850","messageId":"85b5c3130907112207x74449b12qcff25b96711c42e1@mail.gmail.com","threadId":"20060","inReplyTo":"20090709085837.GA12348@bit.office.eurotux.com","subject":"Re: default aliases (ci, di, st, co)","fromName":"Ondrej Certik","fromEmail":"ondrej@certik.cz","sentAt":"2009-07-12T05:07:03Z","receivedAt":"2009-07-12T05:07:03Z","isPatch":false,"sender":{"key":"ondrej@certik.cz","avatar":"https://gravatar.com/avatar/106d05822138a98292e09d1580dbe8f27e05faecd87f13d5d58d889d0687771c?d=mp&s=160"},"body":"On Thu, Jul 9, 2009 at 2:58 AM, Luciano Miguel Ferreira\nRocha<luciano@eurotux.com> wrote:\n> On Thu, Jul 09, 2009 at 09:00:30AM +0200, Andreas Ericsson wrote:\n>>  Ondrej Certik wrote:\n>> > Hi,\n>> > coming to git from mercurial and svn, here is the alias part of my\n>> > .gitconfig:\n>> > [alias]\n>> >     ci = commit\n>> >     di = diff --color-words\n>> >     st = status\n>> >     co = checkout\n>> > And all is fine until I share commands to checkout my branch (for\n>> > example) with other people, then basically I have to write those\n>> > commands in full (e.g. commit, checkout, ...), since I cannot assume\n>> > they have their .gitconfig setup the same way I do. Especially for\n>> > people who are new to git.\n>> > What is the view on this in the git community?\n>>\n>>\n>>  Personally I think \"plain\" aliases like you use above are evil.\n>>  git is not svn or mercurial. If you use it like svn you'll be\n>>  surprised sooner or later and your workflow will feel awkward or\n>>  just plain wrong. hg and git are very similar, but the fact that\n>>  hg assumed the svn shorthands implies to me that they've tried\n>>  to retain a compatibility that does not, in fact, exist.\n>\n> No, it just means that shorting common commands is useful and common.\n>\n>>  I have no simple aliases for any of the commands. There's just no reason\n>>  for them since tab completion works so well.\n>\n> \"Intelligent\" bash completion always gets in my way, so I can't use it.\n>\n> I vote yes.\n\n\n\nThanks everyone for contributing to the discussion. So it seems that\nmost people are against such aliases.\n\nI only want to correct one thing --- I use git exactly because it's\nnot svn and exactly because it's not mercurial, things like git\nbranches, git remote branches, rebase -i, are still truly unique, and\nin my experience once one tries it, he never wants to come back.\n\nThat said, I do use \"git ci\" and \"git st\" very often and I don't think\nit infers any kind of workflow. TAB completion doesn't help, because I\nneed to write \"git stat<TAB>\", e.g. I save exactly one letter., commit\nis better, there I just need \"git com<TAB>\", but I am still faster\nwith my aliases. Maybe \"git co\" is nasty, but I never had any problems\nwith that either.\n\nOndrej\n"},{"id":"117885","messageId":"20090713064027.GA10300@coredump.intra.peff.net","threadId":"20060","inReplyTo":"4A56786B.7040904@gnu.org","subject":"Re: default aliases (ci, di, st, co)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-13T06:40:27Z","receivedAt":"2009-07-13T06:40:27Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 10, 2009 at 01:08:27AM +0200, Paolo Bonzini wrote:\n\n> Yes, it's in the wiki and in my .gitconfig:\n> \n>         whatis = \"!sh -c 'git show -s --pretty=\\\"format:%h (%s, %ai\\\"\n> \\\"$@\\\" | sed -e \\\"s/ [012][0-9]:[0-5][0-9]:[0-5][0-9]\n> [-+][0-9][0-9][0-9][0-9]$/)\\\\n/\\\"' -\"\n\nIs there a reason not to simply use:\n\n  whatis = \"show -s --pretty='format:%h (%s, %ad)' --date=short\"\n\nthese days?\n\n-Peff\n\nP.S. Actually, I use --no-pager in my version, so I use 'tformat' to\nexplicitly end it with a newline, which is nicer for actually showing\nthe output on the terminal.\n"},{"id":"117886","messageId":"20090713064309.GB10300@coredump.intra.peff.net","threadId":"20060","inReplyTo":"20090713064027.GA10300@coredump.intra.peff.net","subject":"Re: default aliases (ci, di, st, co)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-13T06:43:09Z","receivedAt":"2009-07-13T06:43:09Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jul 13, 2009 at 02:40:27AM -0400, Jeff King wrote:\n\n> On Fri, Jul 10, 2009 at 01:08:27AM +0200, Paolo Bonzini wrote:\n> \n> > Yes, it's in the wiki and in my .gitconfig:\n> > \n> >         whatis = \"!sh -c 'git show -s --pretty=\\\"format:%h (%s, %ai\\\"\n> > \\\"$@\\\" | sed -e \\\"s/ [012][0-9]:[0-5][0-9]:[0-5][0-9]\n> > [-+][0-9][0-9][0-9][0-9]$/)\\\\n/\\\"' -\"\n> \n> Is there a reason not to simply use:\n> \n>   whatis = \"show -s --pretty='format:%h (%s, %ad)' --date=short\"\n> \n> these days?\n> \n> -Peff\n> \n> P.S. Actually, I use --no-pager in my version, so I use 'tformat' to\n> explicitly end it with a newline, which is nicer for actually showing\n> the output on the terminal.\n\nEr, actually, I see yours adds the newline explicitly in the sed\ninvocation, so it would definitely be 'tformat' to match what yours\ndoes.\n\n-Peff\n"},{"id":"117893","messageId":"4A5AFB20.6010403@gnu.org","threadId":"20060","inReplyTo":"20090713064027.GA10300@coredump.intra.peff.net","subject":"Re: default aliases (ci, di, st, co)","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-07-13T09:15:12Z","receivedAt":"2009-07-13T09:15:12Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 07/13/2009 08:40 AM, Jeff King wrote:\n> On Fri, Jul 10, 2009 at 01:08:27AM +0200, Paolo Bonzini wrote:\n>\n>> Yes, it's in the wiki and in my .gitconfig:\n>>\n>>          whatis = \"!sh -c 'git show -s --pretty=\\\"format:%h (%s, %ai\\\"\n>> \\\"$@\\\" | sed -e \\\"s/ [012][0-9]:[0-5][0-9]:[0-5][0-9]\n>> [-+][0-9][0-9][0-9][0-9]$/)\\\\n/\\\"' -\"\n>\n> Is there a reason not to simply use:\n>\n>    whatis = \"show -s --pretty='format:%h (%s, %ad)' --date=short\"\n>\n> these days?\n\nWith s/format/tformat, which I just learnt about, no, there is no reason.\n\nThanks!\n\nPaolo\n"}]}