git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Fix '&&' chaining in tests
@ 2011-12-08 13:10 Ramkumar Ramachandra
  2011-12-08 13:10 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra
                   ` (9 more replies)
  0 siblings, 10 replies; 51+ messages in thread
From: Ramkumar Ramachandra @ 2011-12-08 13:10 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, Matthieu Moy, Git List

Hi,

This follows-up $gmane/186481.  Thanks to Jonathan and Matthieu for
going through it.  Changes are:
1. Changes in response to Jonathan's review.
2. Squash similar patches and re-order.

Thanks.

-- Ram

Ramkumar Ramachandra (6):
  t3040 (subprojects-basic): modernize style
  t3030 (merge-recursive): use test_expect_code
  t1006 (cat-file): use test_cmp
  t3200 (branch): fix '&&' chaining
  t1510 (worktree): fix '&&' chaining
  test: fix '&&' chaining

 t/t1006-cat-file.sh                   |  119 +++++++++++++--------------
 t/t1007-hash-object.sh                |    2 +-
 t/t1013-loose-object-format.sh        |    2 +-
 t/t1300-repo-config.sh                |    2 +-
 t/t1412-reflog-loop.sh                |    2 +-
 t/t1501-worktree.sh                   |    6 +-
 t/t1510-repo-setup.sh                 |    4 +-
 t/t1511-rev-parse-caret.sh            |    2 +-
 t/t3030-merge-recursive.sh            |   72 ++---------------
 t/t3040-subprojects-basic.sh          |  144 ++++++++++++++++----------------
 t/t3200-branch.sh                     |    4 +-
 t/t3310-notes-merge-manual-resolve.sh |   10 +-
 t/t3400-rebase.sh                     |    4 +-
 t/t3418-rebase-continue.sh            |    4 +-
 t/t3419-rebase-patch-id.sh            |    2 +-
 15 files changed, 156 insertions(+), 223 deletions(-)

-- 
1.7.7.3

^ permalink raw reply	[flat|nested] 51+ messages in thread
* [PATCH 0/2] Parsing a subcommand using parse-options
@ 2011-12-08 12:07 Ramkumar Ramachandra
  2011-12-08 12:07 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra
  0 siblings, 1 reply; 51+ messages in thread
From: Ramkumar Ramachandra @ 2011-12-08 12:07 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

Hi,

It's been itching me for some time now: I want parse-options to be
able to parse a "subcommand".  It all started when I noticed how ugly
my implementation of '--continue' and '--quit' in git-revert were:
using an OPT_BOOLEAN to parse the option into separate integer
variables, and then using if-else constructs to turn that into an
enum.  Yuck!  Also, wouldn't we all love something like this in the
future?

  git stash show
            ^^ -- The subcommand "show" to the git-stash builtin

Ofcourse, git-stash.sh is just a shell script, and the full motivation
doesn't arise until someone decides to turn it into a C builtin.  So,
I went hunting for a C builtin that used subcommands and found
something relatively obscure: git-bundle.  It does option-parsing by
hand; changing it to use parse-options is the perfect opportunity to
implement this subcommand feature!

Thoughts?

-- Ram

Ramkumar Ramachandra (2):
  parse-options: introduce OPT_SUBCOMMAND
  bundle: rewrite builtin to use parse-options

 builtin/bundle.c         |  111 ++++++++++++++++++++++++++++++----------------
 parse-options.c          |    5 +-
 parse-options.h          |    3 +
 t/t0040-parse-options.sh |   31 +++++++++++++
 test-parse-options.c     |    4 ++
 5 files changed, 114 insertions(+), 40 deletions(-)

-- 
1.7.7.3

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

end of thread, other threads:[~2011-12-15 21:30 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-08 13:10 [PATCH v2 0/6] Fix '&&' chaining in tests Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra
2011-12-08 16:30   ` Jonathan Nieder
2011-12-08 16:43     ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 1/6] t3040 (subprojects-basic): modernize style Ramkumar Ramachandra
2011-12-08 16:34   ` Jonathan Nieder
2011-12-09  7:56     ` Ramkumar Ramachandra
2011-12-09 18:26       ` Junio C Hamano
2011-12-09 18:32         ` Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-08 16:39   ` Jonathan Nieder
2011-12-08 16:47     ` Ramkumar Ramachandra
2011-12-08 17:03       ` Jonathan Nieder
2011-12-08 17:38         ` Ramkumar Ramachandra
2011-12-08 17:59           ` Jonathan Nieder
2011-12-08 19:39             ` Ramkumar Ramachandra
2011-12-08 23:48               ` Junio C Hamano
2011-12-09 13:33                 ` Jakub Narebski
2011-12-09 18:24                   ` Junio C Hamano
2011-12-15 16:45             ` [PATCH 0/2] Improve git-bundle builtin Ramkumar Ramachandra
2011-12-15 16:45               ` [PATCH 1/2] t5704 (bundle): rewrite for larger coverage Ramkumar Ramachandra
2011-12-15 21:16                 ` Jonathan Nieder
2011-12-15 16:45               ` [PATCH 2/2] bundle: rewrite builtin to use parse-options Ramkumar Ramachandra
2011-12-15 21:29                 ` Jonathan Nieder
2011-12-15 20:54               ` [PATCH 0/2] Improve git-bundle builtin Jonathan Nieder
2011-12-15 21:30               ` Junio C Hamano
2011-12-08 13:10 ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-08 13:10 ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-08 13:28   ` Matthieu Moy
2011-12-08 13:33     ` Ramkumar Ramachandra
2011-12-08 13:41       ` Matthieu Moy
2011-12-08 16:55   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-08 17:07   ` Jonathan Nieder
2011-12-08 13:10 ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-08 17:12   ` Jonathan Nieder
2011-12-09  0:00     ` Junio C Hamano
2011-12-08 13:10 ` [PATCH 6/6] test: " Ramkumar Ramachandra
2011-12-08 17:18   ` Jonathan Nieder
2011-12-08 19:55 ` [PATCH v2 0/6] Fix '&&' chaining in tests Junio C Hamano
2011-12-09  5:23   ` Ramkumar Ramachandra
2011-12-09 11:29 ` [PATCH v3 " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 1/6] t3040 (subprojects-basic): fix '&&' chaining, modernize style Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 2/6] t3030 (merge-recursive): use test_expect_code Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 3/6] t1006 (cat-file): use test_cmp Ramkumar Ramachandra
2011-12-09 18:43     ` Junio C Hamano
2011-12-09 18:47       ` Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 4/6] t3200 (branch): fix '&&' chaining Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 5/6] t1510 (worktree): " Ramkumar Ramachandra
2011-12-09 11:29   ` [PATCH 6/6] tests: " Ramkumar Ramachandra
  -- strict thread matches above, loose matches on Subject: below --
2011-12-08 12:07 [PATCH 0/2] Parsing a subcommand using parse-options Ramkumar Ramachandra
2011-12-08 12:07 ` [PATCH 1/2] parse-options: introduce OPT_SUBCOMMAND Ramkumar Ramachandra

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).