git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 29, 2013, 18:58 UTC
Message-ID
<7vtxllsjeh.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAJri6_tm=tk6L1DT=A_BB25jm7b+2Uniw1uSCGtrY5_8X=t_hw@mail.gmail.com>
Bráulio Bhavamitra <brauliobo@gmail.com> 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.
Previous: Duy NguyenNext: Felipe Contreras
Message 13 of 24 in “Re: Highlevel (but simple to implement) commands provided by default for git”
  1. Bráulio BhavamitraMay 29, 2013
  2. Fwd: [git-users] Highlevel (but simple to implement) commands provided by default for gitBráulio Bhavamitra, May 29, 2013
  3. Ramkumar RamachandraMay 29, 2013
  4. Felipe ContrerasMay 29, 2013
  5. Ramkumar RamachandraMay 29, 2013
  6. Felipe ContrerasMay 30, 2013
  7. Junio C HamanoMay 29, 2013
  8. Ramkumar RamachandraMay 29, 2013
  9. Junio C HamanoMay 29, 2013
  10. Ramkumar RamachandraMay 29, 2013
  11. Junio C HamanoJun 2, 2013
  12. Duy NguyenJun 3, 2013
  13. Junio C HamanoMay 29, 2013
  14. Felipe ContrerasMay 29, 2013
  15. Ramkumar RamachandraMay 29, 2013
  16. Felipe ContrerasMay 30, 2013
  17. Ramkumar RamachandraMay 29, 2013
  18. Jonathan NiederMay 29, 2013
  19. Felipe ContrerasMay 30, 2013
  20. Jonathan NiederMay 30, 2013
  21. Felipe ContrerasMay 30, 2013
  22. Jonathan NiederMay 30, 2013
  23. Felipe ContrerasMay 30, 2013
  24. Ramkumar RamachandraMay 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.