commit: more focused advice in the no-changes-staged case
Get series with b4
b4 am 20100725005443.GA18370@burratinoVersions newest first
- v1 Latest9 patches 16 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | wt-status: split wt_status_print into digestible pieceswt-status.c | +46 | 0 replies | |
| 2/9 | wt-status: split off a function for printing submodule summarywt-status.c | +11 | 0 replies | |
| 3/9 | commit: split off a function to fetch the default log messagebuiltin/ | +55 | 0 replies | |
| 4/9 | commit: split commit -s handling into its own functionbuiltin/ | +20 | 0 replies | |
| 5/9 | commit: split off the piece that writes statusbuiltin/ | +85 | 0 replies | |
| 6/9 | t7508 (status): modernize stylet/ | +734 | 1 reply | |
| 7/9 | commit: give empty-commit avoidance code its own functionbuiltin/ | +18 | 0 replies | |
| 8/9 | commit --dry-run: give advice on empty amendbuiltin/ | +8 | 0 replies | |
| 9/9 | commit: suppress status summary when no changes stagedbuiltin/ t/ wt-status.c +1 more | +15 | 8 replies |
Reviews trailers per patch
None of the 9 patches has a Reviewed-by or Acked-by.
| Patch | Thomas Rast | Sverre Rabbelier | Ævar Arnfjörð Bjarmason |
|---|---|---|---|
| Series | Noticed-by Noticed-by | Encouraged-by Encouraged-by | Based-on-patch-by |
| 1/9 | |||
| 2/9 | |||
| 3/9 | |||
| 4/9 | |||
| 5/9 | |||
| 6/9 | |||
| 7/9 | |||
| 8/9 | |||
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [RFC/PATCH 0/9] commit: more focused advice in the no-changes-staged case
Hi,
When last seen[1], this series was a single patch in very rough form, but there have been almost no functional changes since then.
The patches suppress most output when “git commit” is run without stages changed. So instead of
$ git commit # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: dir1/modified # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # actual # dir1/untracked # dir2/modified # dir2/untracked # expect # output # untracked no changes added to commit (use "git add" and/or "git commit -a")
which may cause a newcomer to panic, you get
$ git commit no changes added to commit (use "git add" and/or "git commit -a")
which would just cause her to scratch her head or say “oh, right!” instead. Hopefully these patches will at least provide a reminder to improve the various "no changes" advice messages.
Ideas for future work:
- add some tests
- give the full traditional output if -a or any paths were passed on the command line.
Most of the patches are code clarity improvements which is not strictly related to this topic.
Patch 6 cleans up the most obvious script to add tests for this in, though I have not added any tests to it.
Patch 8 changes commit --dry-run output in a more modest way, to print the same advice Jeff added to commit proper last month. I suspect this is a good change, but input from people who script around commit --dry-run would be welcome.
Patch 9 is the advertised patch. It should be self-explanatory.
Thoughts?
Jonathan Nieder (9):
wt-status: split wt_status_print into digestible pieces
wt-status: give submodule summary printing its own function
commit: split off a function to fetch the default log message
commit: encapsulate commit -s handling in its own function
commit: split off the piece that writes status t7508 (status): modernize style
commit: give empty-commit avoidance code its own function commit --dry-run: give advice on empty amend
commit: suppress status summary when no changes staged
builtin/commit.c | 328 ++++++++------ t/t7508-status.sh | 1380 ++++++++++++++++++++++++++++------------------------- wt-status.c | 103 +++-- wt-status.h | 1 + 4 files changed, 989 insertions(+), 823 deletions(-)
[1] http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/698001/focus=145541