{"thread":{"id":"20977","subject":"[PATCH] Update the usage bundle string.","startedAt":"2009-09-16T21:20:11Z","lastAt":"2009-09-17T16:16:25Z","messageCount":5,"participants":["Thiago Farina","Johannes Sixt","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"123372","messageId":"1253136011-12011-1-git-send-email-tfransosi@gmail.com","threadId":"20977","inReplyTo":null,"subject":"[PATCH] Update the usage bundle string.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2009-09-16T21:20:11Z","receivedAt":"2009-09-16T21:20:11Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"Currently the usage bundle string is not well formatted.\nNow it is formatted and the user can read the string much more easily.\n\nSigned-off-by: Thiago Farina <tfransosi@gmail.com>\n---\n builtin-bundle.c |   12 +++++++++---\n 1 files changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-bundle.c b/builtin-bundle.c\nindex 9b58152..2e98907 100644\n--- a/builtin-bundle.c\n+++ b/builtin-bundle.c\n@@ -11,6 +11,12 @@\n \n static const char *bundle_usage=\"git bundle (create <bundle> <git rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )\";\n \n+static const char builtin_bundle_usage[] = \"\\\n+  git bundle create <file> <git-rev-list args>\\n\\\n+  git bundle verify <file>\\n\\\n+  git bundle list-heads <file> [refname...]\\n\\\n+  git bundle unbundle <file> [refname...]\";\n+\n int cmd_bundle(int argc, const char **argv, const char *prefix)\n {\n \tstruct bundle_header header;\n@@ -19,8 +25,8 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \tint bundle_fd = -1;\n \tchar buffer[PATH_MAX];\n \n-\tif (argc < 3)\n-\t\tusage(bundle_usage);\n+  if (argc < 3)\n+\t\tusage(builtin_bundle_usage);\n \n \tcmd = argv[1];\n \tbundle_file = argv[2];\n@@ -59,5 +65,5 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)\n \t\treturn !!unbundle(&header, bundle_fd) ||\n \t\t\tlist_bundle_refs(&header, argc, argv);\n \t} else\n-\t\tusage(bundle_usage);\n+\t\tusage(builtin_bundle_usage);\n }\n-- \n1.6.5.rc0.dirty\n"},{"id":"123409","messageId":"4AB1D364.1080701@viscovery.net","threadId":"20977","inReplyTo":"1253136011-12011-1-git-send-email-tfransosi@gmail.com","subject":"Re: [PATCH] Update the usage bundle string.","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-09-17T06:12:52Z","receivedAt":"2009-09-17T06:12:52Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Thiago Farina schrieb:\n> @@ -11,6 +11,12 @@\n>  \n>  static const char *bundle_usage=\"git bundle (create <bundle> <git rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )\";\n\nIs this variable still used? Shouldn't it be removed?\n\n> +static const char builtin_bundle_usage[] = \"\\\n> +  git bundle create <file> <git-rev-list args>\\n\\\n> +  git bundle verify <file>\\n\\\n> +  git bundle list-heads <file> [refname...]\\n\\\n> +  git bundle unbundle <file> [refname...]\";\n\nYou indent the usage text. Do other commands do that, too? If you resend,\nit may be worth using this style:\n\nstatic const char builtin_bundle_usage[] =\n\t\"git bundle create <file> <git-rev-list args>\\n\"\n\t\"git bundle verify <file>\\n\"\n...\n\ni.e. not to use backslash-at-eol.\n\n> -\tif (argc < 3)\n> -\t\tusage(bundle_usage);\n> +  if (argc < 3)\n> +\t\tusage(builtin_bundle_usage);\n\nThis re-indentation is an accident, isn't it?\n\n-- Hannes\n"},{"id":"123455","messageId":"a4c8a6d00909170856t69695a33u86fbc7bc1d9a008@mail.gmail.com","threadId":"20977","inReplyTo":"4AB1D364.1080701@viscovery.net","subject":"Re: [PATCH] Update the usage bundle string.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2009-09-17T15:56:24Z","receivedAt":"2009-09-17T15:56:24Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Thu, Sep 17, 2009 at 3:12 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Thiago Farina schrieb:\n>> @@ -11,6 +11,12 @@\n>>\n>>  static const char *bundle_usage=\"git bundle (create <bundle> <git rev-list args> | verify <bundle> | list-heads <bundle> [refname]... | unbundle <bundle> [refname]... )\";\n>\n> Is this variable still used? Shouldn't it be removed?\nYeah it should be removed, I did this in the third email that I sent.\nTo send another revision of the patch I'm doing this:\n$ git commit <filename> --amend\n$ git format-patch -1 --subject-prefix \"Patch vN\"\nBut I'm not sure if this is the correct away to send another set of\nchanges of the same patch. Is right?\n>\n>> +static const char builtin_bundle_usage[] = \"\\\n>> +  git bundle create <file> <git-rev-list args>\\n\\\n>> +  git bundle verify <file>\\n\\\n>> +  git bundle list-heads <file> [refname...]\\n\\\n>> +  git bundle unbundle <file> [refname...]\";\n>\n> You indent the usage text. Do other commands do that, too? If you resend,\n> it may be worth using this style:\n>\n> static const char builtin_bundle_usage[] =\n>        \"git bundle create <file> <git-rev-list args>\\n\"\n>        \"git bundle verify <file>\\n\"\n> ...\n>\n> i.e. not to use backslash-at-eol.\n>\nSure, I will update it to use this style. There is another usage\nstring that uses backslash-at-eol, it is in builtin-pack-objecs.c .\nShould I update this string too?\n>> -     if (argc < 3)\n>> -             usage(bundle_usage);\n>> +  if (argc < 3)\n>> +             usage(builtin_bundle_usage);\n>\n> This re-indentation is an accident, isn't it?\nWas an accident, sorry about that. I configured my editor to use 2\nspaces per indent, tab size 2 and expand tabs to spaces. Git uses 4\nspaces per indent and tab size 4?\n>\n> -- Hannes\n>\n>\n"},{"id":"123456","messageId":"vpqbpl9woac.fsf@bauges.imag.fr","threadId":"20977","inReplyTo":"4AB1D364.1080701@viscovery.net","subject":"Re: [PATCH] Update the usage bundle string.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-09-17T16:04:27Z","receivedAt":"2009-09-17T16:04:27Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Thiago Farina schrieb:\n>\n>> +static const char builtin_bundle_usage[] = \"\\\n>> +  git bundle create <file> <git-rev-list args>\\n\\\n>> +  git bundle verify <file>\\n\\\n>> +  git bundle list-heads <file> [refname...]\\n\\\n>> +  git bundle unbundle <file> [refname...]\";\n>\n> You indent the usage text. Do other commands do that, too? If you resend,\n> it may be worth using this style:\n>\n> static const char builtin_bundle_usage[] =\n> \t\"git bundle create <file> <git-rev-list args>\\n\"\n> \t\"git bundle verify <file>\\n\"\n\nI like aligned usage strings, like:\n\n$ git stash -h\nUsage: git stash list [<options>]\n   or: git stash show [<stash>]\n   or: git stash drop [-q|--quiet] [<stash>]\n   or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]\n   or: git stash branch <branchname> [<stash>]\n   or: git stash [save [-k|--keep-index] [-q|--quiet] [<message>]]\n   or: git stash clear\n\nor\n\n$ git branch -h |& head -n 4\nusage: git branch [options] [-r | -a] [--merged | --no-merged]\n   or: git branch [options] [-l] [-f] <branchname> [<start-point>]\n   or: git branch [options] [-r] (-d | -D) <branchname>\n   or: git branch [options] (-m | -M) [<oldbranch>] <newbranch>\n\nbut Git isn't very consistant here:\n\n$ git bisect -h |& head  -n 6\nUsage: git bisect [help|start|bad|good|skip|next|reset|visualize|replay|log|run]\n\ngit bisect help\n        print this long help message.\ngit bisect start [<bad> [<good>...]] [--] [<pathspec>...]\n        reset bisect state and start bisection.\n\n--\nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"123457","messageId":"a4c8a6d00909170916u6ba05e36u3b65cc6d9bd726fd@mail.gmail.com","threadId":"20977","inReplyTo":"vpqbpl9woac.fsf@bauges.imag.fr","subject":"Re: [PATCH] Update the usage bundle string.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2009-09-17T16:16:25Z","receivedAt":"2009-09-17T16:16:25Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Thu, Sep 17, 2009 at 1:04 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n>\n>> Thiago Farina schrieb:\n>>\n>>> +static const char builtin_bundle_usage[] = \"\\\n>>> +  git bundle create <file> <git-rev-list args>\\n\\\n>>> +  git bundle verify <file>\\n\\\n>>> +  git bundle list-heads <file> [refname...]\\n\\\n>>> +  git bundle unbundle <file> [refname...]\";\n>>\n>> You indent the usage text. Do other commands do that, too? If you resend,\n>> it may be worth using this style:\n>>\n>> static const char builtin_bundle_usage[] =\n>>       \"git bundle create <file> <git-rev-list args>\\n\"\n>>       \"git bundle verify <file>\\n\"\n>\n> I like aligned usage strings, like:\n>\n> $ git stash -h\n> Usage: git stash list [<options>]\n>   or: git stash show [<stash>]\n>   or: git stash drop [-q|--quiet] [<stash>]\n>   or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]\n>   or: git stash branch <branchname> [<stash>]\n>   or: git stash [save [-k|--keep-index] [-q|--quiet] [<message>]]\n>   or: git stash clear\n>\n> or\n>\n> $ git branch -h |& head -n 4\n> usage: git branch [options] [-r | -a] [--merged | --no-merged]\n>   or: git branch [options] [-l] [-f] <branchname> [<start-point>]\n>   or: git branch [options] [-r] (-d | -D) <branchname>\n>   or: git branch [options] (-m | -M) [<oldbranch>] <newbranch>\n>\nI like and prefer this style too. I can use it in my patch, like:\n$ git bundle -h\nusage: git bundle create <file> <git-rev-list args>\n  or: git bundle verify <file>\n  or: git bundle list-heads <file> [refname...]\n  or: git bundle unbundle <file> [refname...]\n\ninstead of:\nusage: git bundle create <file> <git-rev-list args>\n          git bundle verify <file>\n          git bundle list-heads <file> [refname...]\n          git bundle unbundle <file> [refname...]\n\n> but Git isn't very consistant here:\n>\n> $ git bisect -h |& head  -n 6\n> Usage: git bisect [help|start|bad|good|skip|next|reset|visualize|replay|log|run]\n>\n> git bisect help\n>        print this long help message.\n> git bisect start [<bad> [<good>...]] [--] [<pathspec>...]\n>        reset bisect state and start bisection.\n>\n> --\n> Matthieu Moy\n> http://www-verimag.imag.fr/~moy/\n>\n"}]}