supporting roaming via git URL rewriting

Adam Spiers vcs-home at adamspiers.org
Fri Dec 23 16:06:19 CET 2011


On Fri, Dec 23, 2011 at 3:01 PM, Adam Spiers <vcs-home at adamspiers.org> wrote:
> In the USB case, it's as simple as:
>
>    shorthost="${HOST%%.*}"

Sorry, one of these two might work better depending on your OS and
shell:

    shorthost="${HOSTNAME%%.*}"

    shorthost=`hostname -s`

Careful with that last one on non-Linux UNIX machines though.  In a
previous job, years ago when I was still (ahem) naive and
inexperienced, I once accidentally ran that in parallel on several
hundred production Solaris machines, which resulted in setting all
their hostnames to '-s'.  Oops :)  I think I realised my error and
changed them back quick enough to avoid triggering too many alarm
bells though.


More information about the vcs-home mailing list