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

Re: [PATCH 8/8] gitk: show modified files with separate work tree

From
Paul Mackerras <paulus@samba.org>
Date
Apr 10, 2011, 02:03 UTC
Message-ID
<20110410020318.GB25368@brick.ozlabs.ibm.com>
In-Reply-To
<1301969659-19703-9-git-send-email-martin.von.zweigbergk@gmail.com>
On Mon, Apr 04, 2011 at 10:14:19PM -0400, Martin von Zweigbergk wrote:
> Is the test in proc hasworktree good?

The first parameter to 'if' is evaluated as an expression, so you don't need the extra exprs.

Show 5 quoted lines
> Why do git commands that need a work tree not work under .git? Why
> don't they show the same output as if they had been run from the work
> tree? (Btw, the check for valid work tree does not work for aliases,
> so e.g. 'git st', with 'st' as alias for 'status' will show all files
> as deleted.)
Don't know, ask Junio. :)
> How do I simplify the Tcl code to just return the boolean right away?
You can do:
    return [expr {[exec git rev-parse --is-bare-repository] == "false" &&
		  [exec git rev-parse --is-inside-git-dir] == "false"}]
> Why is the hasworktree variable reset in updatecommits? The only reason
> I can think of is when 'core.worktree' is set/changed, but I don't
> think that case worked very well before this series anyway. Should
> gitdir also be recalculated?

I don't know that there's any particularly strong reason to do it in updatecommits. It could probably be done once at startup.

Paul.
Previous: Martin von ZweigbergkNext: Junio C Hamano
Message 12 of 15 in “make gitk work better in non-top-level directory”
  1. 0/8 make gitk work better in non-top-level directoryMartin von Zweigbergk, Apr 5, 2011
  2. 1/8 gitk: fix file highlight when run in subdirectoryMartin von Zweigbergk, Apr 5, 2011
  3. Paul MackerrasApr 10, 2011
  4. Martin von ZweigbergkApr 10, 2011
  5. 2/8 gitk: fix "show origin of this line" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  6. 3/8 gitk: fix "blame parent commit" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  7. 4/8 gitk: fix "External diff" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  8. 5/8 gitk: put temporary directory inside .gitMartin von Zweigbergk, Apr 5, 2011
  9. 6/8 gitk: run 'git rev-parse --git-dir' only onceMartin von Zweigbergk, Apr 5, 2011
  10. 7/8 gitk: simplify calculation of gitdirMartin von Zweigbergk, Apr 5, 2011
  11. 8/8 gitk: show modified files with separate work treeMartin von Zweigbergk, Apr 5, 2011
  12. Paul MackerrasApr 10, 2011
  13. Junio C HamanoApr 11, 2011
  14. 8/8 gitk: show modified files with separate work treeMartin von Zweigbergk, May 24, 2011
  15. Peter BaumannApr 5, 2011

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.