git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org
Subject: [PATCH] gitk: do not show local changes for bare repositories
Date: Thu,  6 Mar 2008 04:39:24 -0800	[thread overview]
Message-ID: <64b42ab91804e670057c807fd8265fc07106792c.1204806475.git.davvid@gmail.com> (raw)

Launching gitk on a bare repository would previously show the
work tree as having removed all files.  We now test for bare
repositories before showing local changes.

Signed-off-by: David Aguilar <davvid@gmail.com>
---
 gitk |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gitk b/gitk
index f1f21e9..cc4cde3 100755
--- a/gitk
+++ b/gitk
@@ -2843,9 +2843,9 @@ proc dohidelocalchanges {} {
 
 # spawn off a process to do git diff-index --cached HEAD
 proc dodiffindex {} {
-    global localirow localfrow lserial showlocalchanges
+    global localirow localfrow lserial showlocalchanges isbare
 
-    if {!$showlocalchanges} return
+    if {!$showlocalchanges || $isbare} return
     incr lserial
     set localfrow -1
     set localirow -1
@@ -8643,6 +8643,7 @@ set patchnum 0
 set localirow -1
 set localfrow -1
 set lserial 0
+set isbare [expr {[exec git rev-parse --is-bare-repository] == "true"}]
 setcoords
 makewindow
 # wait for the window to become visible
-- 
1.5.4.rc2.1105.gfc5f2


             reply	other threads:[~2008-03-06 12:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 12:39 David Aguilar [this message]
2008-03-06 23:07 ` [PATCH] gitk: do not show local changes for bare repositories Paul Mackerras
2008-03-07  9:04 ` David Aguilar
2008-03-08 11:14   ` Paul Mackerras
2008-03-10 10:54     ` [PATCH] gitk: do not show local changes when we there is no work tree David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64b42ab91804e670057c807fd8265fc07106792c.1204806475.git.davvid@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).