All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH 0/9] commit: more focused advice in the no-changes-staged case
@ 2010-07-25  0:54 Jonathan Nieder
  2010-07-25  0:56 ` [PATCH 1/9] wt-status: split wt_status_print into digestible pieces Jonathan Nieder
                   ` (9 more replies)
  0 siblings, 10 replies; 38+ messages in thread
From: Jonathan Nieder @ 2010-07-25  0:54 UTC (permalink / raw)
  To: git; +Cc: Jakub Narebski, Jeff King, Thomas Rast

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

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2010-08-20 17:51 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-25  0:54 [RFC/PATCH 0/9] commit: more focused advice in the no-changes-staged case Jonathan Nieder
2010-07-25  0:56 ` [PATCH 1/9] wt-status: split wt_status_print into digestible pieces Jonathan Nieder
2010-07-25  0:57 ` [PATCH 2/9] wt-status: split off a function for printing submodule summary Jonathan Nieder
2010-07-25  0:58 ` [PATCH 3/9] commit: split off a function to fetch the default log message Jonathan Nieder
2010-07-25  0:58 ` [PATCH 4/9] commit: split commit -s handling into its own function Jonathan Nieder
2010-07-25  0:59 ` [PATCH 5/9] commit: split off the piece that writes status Jonathan Nieder
2010-07-25  0:59 ` [PATCH 6/9] t7508 (status): modernize style Jonathan Nieder
2010-07-25  8:38   ` Ævar Arnfjörð Bjarmason
2010-07-25  1:00 ` [PATCH 7/9] commit: give empty-commit avoidance code its own function Jonathan Nieder
2010-07-25  1:01 ` [PATCH 8/9] commit --dry-run: give advice on empty amend Jonathan Nieder
2010-07-25  1:02 ` [PATCH 9/9] commit: suppress status summary when no changes staged Jonathan Nieder
2010-08-11  7:11   ` Thomas Rast
2010-08-11  7:30     ` Jonathan Nieder
2010-08-11  7:49       ` [PATCH v2] t6040 (branch tracking): check “status” instead of “commit” Jonathan Nieder
2010-08-12  0:45         ` Ævar Arnfjörð Bjarmason
2010-08-11 12:15       ` [PATCH 9/9] commit: suppress status summary when no changes staged Ævar Arnfjörð Bjarmason
2010-08-11 23:57         ` Jonathan Nieder
2010-08-12  0:05           ` Ævar Arnfjörð Bjarmason
2010-08-12  0:10             ` Jonathan Nieder
2010-07-25  8:54 ` [RFC/PATCH 0/9] commit: more focused advice in the no-changes-staged case Ævar Arnfjörð Bjarmason
2010-07-25  9:22   ` Thomas Rast
2010-07-29 23:51     ` Making error messages stand out (Re: [RFC/PATCH 0/9] commit: more focused advice in the no-changes-staged case) Jonathan Nieder
2010-07-30 18:44       ` Sverre Rabbelier
2010-08-11  8:31         ` [WIP/PATCH 0/4] Re: Making error messages stand out Jonathan Nieder
2010-08-11  8:36           ` [PATCH 1/4] Eliminate “Finished cherry-pick/revert” message Jonathan Nieder
2010-08-11  8:36           ` [PATCH 2/4] Introduce advise() to print hints Jonathan Nieder
2010-08-11  8:37           ` [PATCH 3/4] cherry-pick/revert: Use error() for failure message Jonathan Nieder
2010-08-11  8:37           ` [PATCH 4/4] cherry-pick/revert: Use advise() for hints Jonathan Nieder
2010-08-11  9:21           ` [WIP/PATCH 0/4] Re: Making error messages stand out Nguyen Thai Ngoc Duy
2010-08-11  9:39             ` Matthieu Moy
2010-08-11  9:58               ` Nguyen Thai Ngoc Duy
2010-08-11 17:34           ` Sverre Rabbelier
2010-08-18 14:36           ` [PATCH] tests: fix syntax error in "Use advise() for hints" test Ævar Arnfjörð Bjarmason
2010-08-19  4:30             ` Jonathan Nieder
2010-08-19 12:22               ` Ævar Arnfjörð Bjarmason
2010-08-20 10:13                 ` Raja R Harinath
2010-08-20 14:22                   ` Ævar Arnfjörð Bjarmason
2010-08-20 17:51                     ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.