Comment

Comment by gavinpc

Regarding

    alias ssh=’ssh -AX’
    alias ls=’ls –color=auto’
Let me quote the Mercurial manual:

> It is possible to create aliases with the same names as existing commands, which will then override the original definitions. This is almost always a bad idea![0]

I was recently bitten by this when running a build on a new machine. I was doing a

    log -r "$revision"
and instead of getting one commit message (as usual), I was getting the entire log history up to $revision.

I managed to find that Mercurial had made a breaking change[1] so that `log -fr` would now have the observed behavior. But I was only running `log -r`!

But on the old machine, I had in my .hgrc the alias

    log=log -f 
To top it off, I also had a comment with the above quote that this is "almost always a bad idea!" Consider me burned!

[0] https://www.selenic.com/mercurial/hgrc.5.html#alias

[1] https://www.mercurial-scm.org/wiki/UpgradeNotes#A3.4:_minor_...

parent gavinpc 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton