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

Re: [PATCH 2/2] Use $(git rev-parse --show-toplevel) in cd_to_toplevel()

From
SDSteven Drake <sdrake@xnet.co.nz>
Date
Jan 11, 2010, 07:12 UTC
Message-ID
<alpine.LNX.2.00.1001111354470.7728@vqena.qenxr.bet.am>
In-Reply-To
<20100110101154.GA18138@progeny.tock>
On Sun, 10 Jan 2010, Jonathan Nieder wrote:
> Why not 'cdup=$(git rev-parse --show-toplevel) && cd "$cdup"'
> unconditionally?  That would avoid having to look for the .git dir
> twice and would mirror setup_work_tree() a bit more closely.

Depends on what you think is the lesser of to evials, running 'git rev-parse' twice or preforming a cd when theres no need to, but after looking at setup_work_tree() I agree with you and will send in a new patch.

-- 
Steven
Previous: Jonathan NiederNext: Steven Drake
Message 3 of 7 in “Use $(git rev-parse --show-toplevel) in cd_to_toplevel()”
  1. 2/2 Use $(git rev-parse --show-toplevel) in cd_to_toplevel()Steven Drake, Jan 10, 2010
  2. Jonathan NiederJan 10, 2010
  3. Steven DrakeJan 11, 2010
  4. 2/2 Use $(git rev-parse --show-toplevel) in cd_to_toplevel()Steven Drake, Jan 11, 2010
  5. Junio C HamanoJan 11, 2010
  6. Steven DrakeJan 11, 2010
  7. Junio C HamanoJan 11, 2010

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.