Skip to contentSkip to conversation

runstatus: restructure visual appearance

RFC/PATCH Lars Hjemli 3 participants 5 messages Aug 11, 2016 Documentation

lore
Share & tools
lore
#4 lore raw
In reply to Lars Hjemli
Quoted 5 lines · Lars Hjemli
Quoted 3 lines

If we are designing a new format to make git-status output more compact and easier to understand, I think it should also attempt to address this [mode-change] problem as well.

Excellent point, I'll use it as an excuse to refine and resend the patch.

If you are so inclined, you might google on list for a patch I submitted down this line last year sometime?

jdl

#3 lore raw
In reply to Junio C Hamano
Quoted 6 lines · Junio C Hamano
Quoted 1 line · Lars Hjemli

Just wondering if this patch got dropped or simply overlooked...

I looked at the patch, and I was neutral to slightly negative (but only slightly. I thought M vs M+ was too subtle and cryptic until the user gets used to them).

Hmm, yes, I agree it's a bit subtle. But whenever the '+' or '-' is added to a state symbol, the big warning that is printed should make it less so (the warning should also mention git-rm, btw).

And of course the man-page for git-status should be updated to describe the different state symbols, the meaning of +/-, and how to 'resolve' them.

Quoted 2 lines

I however did not see overwhelming support from the list, so I did not further think about it.

The silence was earth shattering

Quoted 5 lines

One thing that was mentioned in the past on the list about the output from git-status was that we do not make mode changes stand out, and people can mistakenly do something silly to change the -x bit and the current git-status would only say:

Quoted 8 lines

modified: git-foobar.sh

which would not help them notice the mistake, as a result, accidental mode change can get committed.

If we are designing a new format to make git-status output more compact and easier to understand, I think it should also attempt to address this problem as well.

Excellent point, I'll use it as an excuse to refine and resend the patch.

#0 lore raw

Modify the output from runstatus so that all modified files are shown in the same list, prefixed with a state symbol (A/C/D/M/R/T/X/U) and possibly a state modifier (+/-).

The '+' indicates that the working copy has been changed since the file was added to the index, while the '-' indicates that the file hasn't been added to the index at all.

If either '+' or '-' is displayed for any of the modified files, then a big warning is printed, informing the user that she might want to run 'git commit -a' or 'git add file'.

Experienced users who find this warning annoying, can turn if off with 'git repo-config status.showwarning 0'.

---

This is a rather subjective 'improvement', but I think it makes the commit message easier to comprehend and I hope that goes for both new and experienced users.

Btw: the warning message somewhat implies that 'git add' can be used to add changed content to the index, even for files already added. So I obviously liked the patch Nicolas Pitre sendt earlier today...

 Documentation/git-runstatus.txt |   28 +++
 wt-status.c                     |  384 +++++++++++++++++++++++----------------
 wt-status.h                     |    1 +
 3 files changed, 260 insertions(+), 153 deletions(-)
Documentation/git-runstatus.txt +28 -0
index 89d7b92..cc6ed92 100644
@@ -53,6 +53,34 @@ OUTPUT
 The output from this command is designed to be used as a commit
 template comments, and all the output lines are prefixed with '#'.
 
+EXAMPLES
+--------
+
++
+--------
+$ git runstatus
+#
+# On branch refs/heads/runstatus
+#
+# Modified files
+#   M  Documentation/git-runstatus.txt
+#   M+ wt-status.c
+#
+# WARNING:
+#   If you want to commit all of your changes, you need to run
+#   'git commit -a' (or 'git add file...' for selected files).
+#
+$ git add wt-status.c
+$ git runstatus
+#
+# On branch refs/heads/runstatus
+#
+# Modified files
+#   M  Documentation/git-runstatus.txt
+#   M  wt-status.c
+#
+--------
++
 
 Author
 ------
wt-status.c +231 -153

454 lines not on this page · raw message

wt-status.h +1 -0
index 0a5a5b7..b8337ee 100644
@@ -6,6 +6,7 @@ enum color_wt_status {
 	WT_STATUS_UPDATED,
 	WT_STATUS_CHANGED,
 	WT_STATUS_UNTRACKED,
+	WT_STATUS_WARNING
 };
 
 struct wt_status {
Signature · 1 line
1.4.4.1.g1210
#1 lore raw
Quoted 3 lines · Lars Hjemli

This is a rather subjective 'improvement', but I think it makes the commit message easier to comprehend and I hope that goes for both new and experienced users.

Just wondering if this patch got dropped or simply overlooked...

If dropped, sorry for the noise

#2 lore raw
Quoted 6 lines · Lars Hjemli
Quoted 3 lines · Lars Hjemli

This is a rather subjective 'improvement', but I think it makes the commit message easier to comprehend and I hope that goes for both new and experienced users.

Just wondering if this patch got dropped or simply overlooked...

I looked at the patch, and I was neutral to slightly negative (but only slightly. I thought M vs M+ was too subtle and cryptic until the user gets used to them).

I however did not see overwhelming support from the list, so I did not further think about it.

One thing that was mentioned in the past on the list about the output from git-status was that we do not make mode changes stand out, and people can mistakenly do something silly to change the -x bit and the current git-status would only say:

modified: git-foobar.sh

which would not help them notice the mistake, as a result, accidental mode change can get committed.

If we are designing a new format to make git-status output more compact and easier to understand, I think it should also attempt to address this problem as well.