author | Stephen Boyd <bebarino@gmail.com> | |
Sat, 27 Feb 2010 08:59:22 +0000 (00:59 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 13 Mar 2010 06:09:18 +0000 (22:09 -0800) | ||
commit | 74884b524e7e12b3419264d3180de785a9e39fa5 | |
tree | f6552409c466066c148caaadedf51f6be4f94b12 | tree | snapshot |
parent | 66d681998411e8e5034080d5267a5e0f6cdc0c17 | commit | diff |
notes: rework subcommands and parse options
Running 'git notes copy -h' is not very helfpul right now. It lists
the options for all the git notes subcommands and is rather confusing.
Fix this by splitting cmd_notes() into separate functions for each
subcommand (besides append and edit since they're very similar) and
only providing a usage message for the subcommand.
This has an added benefit of reducing the code complexity while making
it safer and easier to read. The downside is we get some code bloat
from similar setup and teardown needed for notes and options parsing.
We also get a bit stricter in options parsing by only allowing
the ref option to come before the subcommand.
Acked-by: Johan Herland <johan@herland.net>
Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Running 'git notes copy -h' is not very helfpul right now. It lists
the options for all the git notes subcommands and is rather confusing.
Fix this by splitting cmd_notes() into separate functions for each
subcommand (besides append and edit since they're very similar) and
only providing a usage message for the subcommand.
This has an added benefit of reducing the code complexity while making
it safer and easier to read. The downside is we get some code bloat
from similar setup and teardown needed for notes and options parsing.
We also get a bit stricter in options parsing by only allowing
the ref option to come before the subcommand.
Acked-by: Johan Herland <johan@herland.net>
Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-notes.c | diff | blob | history | |
t/t3301-notes.sh | diff | blob | history |