Re: Fwd: [git-users] Highlevel (but simple to implement) commands provided by default for git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bráulio Bhavamitra <brauliobo@xxxxxxxxx> writes:

>   root = rev-parse --show-toplevel

Hmm, part of my "cdup" shell function looks something like

     cdup () {
	... error detection etc...
	d=$(git rev-parse --show-toplevel)
        cd "$d"
    }

so I can quickly go up to the top-level.  With "root", I could
replace that rev-parse call with "git root", but I'd keep typing

	$ cdup

after doing so anyway.  I am not sure how much value it adds.

You would need to handle error cases like "you are not in a working
tree", you cannot expect to be able to say

	$ cd "$(git root)"

anyway.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]