{"thread":{"id":"766","subject":"[PATCH] Cleanup cogito command usage reporting","startedAt":"2005-05-30T02:36:03Z","lastAt":"2005-05-31T01:36:44Z","messageCount":4,"participants":["Jonas Fonseca","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4229","messageId":"20050530023603.GC10715@diku.dk","threadId":"766","inReplyTo":null,"subject":"[PATCH] Cleanup cogito command usage reporting","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-05-30T02:36:03Z","receivedAt":"2005-05-30T02:36:03Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Add usage utility function which uses the recently introduced USAGE variables.\nMinor fix and improvement of cg-clone documentation.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\n cg-Xlib       |    3 +++\n cg-add        |    2 +-\n cg-branch-add |    2 +-\n cg-clone      |    5 +++--\n cg-export     |    2 +-\n cg-merge      |    4 ++--\n cg-rm         |    2 +-\n cg-tag        |    2 +-\n 8 files changed, 13 insertions(+), 9 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -17,6 +17,9 @@ die () {\n \texit 1\n }\n \n+usage() {\n+\tdie \"usage: $USAGE\"\n+}\n \n mktemp () {\n \tif [ ! \"$BROKEN_MKTEMP\" ]; then\ndiff --git a/cg-add b/cg-add\n--- a/cg-add\n+++ b/cg-add\n@@ -22,7 +22,7 @@ USAGE=\"cg-add FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-add FILE...\"\n+[ \"$1\" ] || usage\n \n TMPFILE=$(mktemp -t gitadd.XXXXXX)\n find \"$@\" -type f > $TMPFILE || die \"not all files exist, nothing added\"\ndiff --git a/cg-branch-add b/cg-branch-add\n--- a/cg-branch-add\n+++ b/cg-branch-add\n@@ -42,7 +42,7 @@ USAGE=\"cg-branch-add BRANCH LOCATION\"\n name=$1\n location=$2\n \n-([ \"$name\" ] && [ \"$location\" ]) || die \"usage: cg-branch-add NAME SOURCE_LOC\"\n+([ \"$name\" ] && [ \"$location\" ]) || usage\n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\n \tdie \"name contains invalid characters\"\n if [ \"$name\" = \"this\" ] || [ \"$name\" = \"HEAD\" ]; then\ndiff --git a/cg-clone b/cg-clone\n--- a/cg-clone\n+++ b/cg-clone\n@@ -15,11 +15,12 @@\n # -------\n # -s::\n #\tClone in the current directory instead of creating a new one.\n+#\tSpecifying both -s and a desination directory makes no sense.\n #\n # -h, --help::\n #\tPrint usage help\n \n-USAGE=\"cg-clone [-s] LOCATION [<directory>]\"\n+USAGE=\"cg-clone [-s] LOCATION [DESTINATION]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n@@ -30,7 +31,7 @@ if [ \"$1\" = \"-s\" ]; then\n fi\n \n location=$1\n-[ \"$location\" ] || die \"usage: cg-clone [-s] SOURCE_LOC [DESTDIR]\"\n+[ \"$location\" ] || usage\n location=${location%/}\n \n destdir=$2\ndiff --git a/cg-export b/cg-export\n--- a/cg-export\n+++ b/cg-export\n@@ -22,7 +22,7 @@ USAGE=\"cg-export DESTINATION [TREE]\"\n dest=$1\n id=$(tree-id $2)\n \n-([ \"$dest\" ] && [ \"$id\" ]) || die \"usage: cg-export DEST [TREE_ID]\"\n+([ \"$dest\" ] && [ \"$id\" ]) || usage\n \n [ -e \"$dest\" ] && die \"$dest already exists.\"\n \ndiff --git a/cg-merge b/cg-merge\n--- a/cg-merge\n+++ b/cg-merge\n@@ -38,11 +38,11 @@ fi\n base=\n if [ \"$1\" = \"-b\" ]; then\n \tshift\n-\t[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+\t[ \"$1\" ] || usage\n \tbase=$(commit-id \"$1\") || exit 1; shift\n fi\n \n-[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+[ \"$1\" ] || usage\n branchname=\"$1\"\n branch=$(commit-id \"$branchname\") || exit 1\n \ndiff --git a/cg-rm b/cg-rm\n--- a/cg-rm\n+++ b/cg-rm\n@@ -15,7 +15,7 @@ USAGE=\"cg-rm FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-rm FILE...\"\n+[ \"$1\" ] || usage\n \n rm -f \"$@\"\n git-update-cache --remove -- \"$@\"\ndiff --git a/cg-tag b/cg-tag\n--- a/cg-tag\n+++ b/cg-tag\n@@ -20,7 +20,7 @@ USAGE=\"cg-tag TAG [REVISION]\"\n name=$1\n id=$2\n \n-[ \"$name\" ] || die \"usage: cg-tag TNAME [COMMIT_ID]\"\n+[ \"$name\" ] || usage\n [ \"$id\" ] || id=$(commit-id)\n \n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\n-- \nJonas Fonseca\n"},{"id":"4230","messageId":"20050530030521.GA13232@diku.dk","threadId":"766","inReplyTo":"20050530023603.GC10715@diku.dk","subject":"Re: [PATCH] Cleanup cogito command usage reporting","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-05-30T03:05:21Z","receivedAt":"2005-05-30T03:05:21Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"[ Sorry for the resend. This should bring all usage strings in sync. I\n  forgot to add the new options. ]\n\n - Synchronize usage strings with those in cg-help. The command\n   identifiers are still not as descriptive, though.\n - Add usage utility function which uses the recently introduced USAGE\n   variables.\n - Minor fix and improvement of cg-clone documentation.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\n cg-Xlib       |    3 +++\n cg-add        |    2 +-\n cg-branch-add |    2 +-\n cg-clone      |    5 +++--\n cg-commit     |    4 ++--\n cg-diff       |    2 +-\n cg-export     |    2 +-\n cg-help       |    2 +-\n cg-log        |    2 +-\n cg-merge      |    4 ++--\n cg-mkpatch    |    2 +-\n cg-rm         |    2 +-\n cg-tag        |    2 +-\n 13 files changed, 19 insertions(+), 15 deletions(-)\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -17,6 +17,9 @@ die () {\n \texit 1\n }\n \n+usage() {\n+\tdie \"usage: $USAGE\"\n+}\n \n mktemp () {\n \tif [ ! \"$BROKEN_MKTEMP\" ]; then\ndiff --git a/cg-add b/cg-add\n--- a/cg-add\n+++ b/cg-add\n@@ -22,7 +22,7 @@ USAGE=\"cg-add FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-add FILE...\"\n+[ \"$1\" ] || usage\n \n TMPFILE=$(mktemp -t gitadd.XXXXXX)\n find \"$@\" -type f > $TMPFILE || die \"not all files exist, nothing added\"\ndiff --git a/cg-branch-add b/cg-branch-add\n--- a/cg-branch-add\n+++ b/cg-branch-add\n@@ -42,7 +42,7 @@ USAGE=\"cg-branch-add BRANCH LOCATION\"\n name=$1\n location=$2\n \n-([ \"$name\" ] && [ \"$location\" ]) || die \"usage: cg-branch-add NAME SOURCE_LOC\"\n+([ \"$name\" ] && [ \"$location\" ]) || usage\n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\n \tdie \"name contains invalid characters\"\n if [ \"$name\" = \"this\" ] || [ \"$name\" = \"HEAD\" ]; then\ndiff --git a/cg-clone b/cg-clone\n--- a/cg-clone\n+++ b/cg-clone\n@@ -15,11 +15,12 @@\n # -------\n # -s::\n #\tClone in the current directory instead of creating a new one.\n+#\tSpecifying both -s and a desination directory makes no sense.\n #\n # -h, --help::\n #\tPrint usage help\n \n-USAGE=\"cg-clone [-s] LOCATION [<directory>]\"\n+USAGE=\"cg-clone [-s] LOCATION [DESTINATION]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n@@ -30,7 +31,7 @@ if [ \"$1\" = \"-s\" ]; then\n fi\n \n location=$1\n-[ \"$location\" ] || die \"usage: cg-clone [-s] SOURCE_LOC [DESTDIR]\"\n+[ \"$location\" ] || usage\n location=${location%/}\n \n destdir=$2\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -20,7 +20,7 @@\n #\tNote, this is used internally by Cogito when merging. This option\n #\tdoes not make sense when files are given on the command line.\n #\n-# -m<message>::\n+# -mMESSAGE::\n #\tSpecify the commit message, which is used instead of starting\n #\tup an editor (if the input is not `stdin`, the input is appended\n #\tafter all the '-m' messages). Multiple '-m' parameters are appended\n@@ -75,7 +75,7 @@\n # EDITOR::\n #\tThe editor used for entering revision log information.\n \n-USAGE=\"cg-commit [-m<message>]... [-C] [-e | -E] [FILE]...\"\n+USAGE=\"cg-commit [-mMESSAGE]... [-C] [-e | -E] [FILE]...\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-diff b/cg-diff\n--- a/cg-diff\n+++ b/cg-diff\n@@ -30,7 +30,7 @@\n # -h, --help::\n #\tPrint usage help.\n \n-USAGE=\"cg-diff [-p] [-r REVISION[:REVISION]] [FILE]...\"\n+USAGE=\"cg-diff [-c] [-m] [-p] [-r REVISION[:REVISION]] [FILE]...\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-export b/cg-export\n--- a/cg-export\n+++ b/cg-export\n@@ -22,7 +22,7 @@ USAGE=\"cg-export DESTINATION [TREE]\"\n dest=$1\n id=$(tree-id $2)\n \n-([ \"$dest\" ] && [ \"$id\" ]) || die \"usage: cg-export DEST [TREE_ID]\"\n+([ \"$dest\" ] && [ \"$id\" ]) || usage\n \n [ -e \"$dest\" ] && die \"$dest already exists.\"\n \ndiff --git a/cg-help b/cg-help\n--- a/cg-help\n+++ b/cg-help\n@@ -43,7 +43,7 @@ Available commands:\n \tcg-export\tDEST [TREE_ID]\n \tcg-help\t\t[COMMAND]\n \tcg-init\n-\tcg-log\t\t[-c] [-f] [-m] [-r FROM_ID[:TO_ID]] [FILE]...\n+\tcg-log\t\t[-c] [-f] [-m] [-uUSERNAME] [-r FROM_ID[:TO_ID]] [FILE]...\n \tcg-ls\t\t[TREE_ID]\n \tcg-merge\t[-c] [-b BASE_ID] FROM_ID\n \tcg-mkpatch\t[-m] [-s] [-r FROM_ID[:TO_ID]]\ndiff --git a/cg-log b/cg-log\n--- a/cg-log\n+++ b/cg-log\n@@ -58,7 +58,7 @@\n #\n #\t$ cg-log -r releasetag-0.9:releasetag-0.10\n \n-USAGE=\"cg-log [-c] [-f] [-uUSERNAME] [-r REVISION[:REVISION]] FILE...\"\n+USAGE=\"cg-log [-c] [-f] [-m] [-uUSERNAME] [-r REVISION[:REVISION]] FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n # Try to fix the annoying \"Broken pipe\" output. May not help, but apparently\ndiff --git a/cg-merge b/cg-merge\n--- a/cg-merge\n+++ b/cg-merge\n@@ -38,11 +38,11 @@ fi\n base=\n if [ \"$1\" = \"-b\" ]; then\n \tshift\n-\t[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+\t[ \"$1\" ] || usage\n \tbase=$(commit-id \"$1\") || exit 1; shift\n fi\n \n-[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+[ \"$1\" ] || usage\n branchname=\"$1\"\n branch=$(commit-id \"$branchname\") || exit 1\n \ndiff --git a/cg-mkpatch b/cg-mkpatch\n--- a/cg-mkpatch\n+++ b/cg-mkpatch\n@@ -37,7 +37,7 @@\n # the line\n # `!-------------------------------------------------------------flip-`\n \n-USAGE=\"cg-mkpatch [-s] [-r REVISION[:REVISION]]\"\n+USAGE=\"cg-mkpatch [-m] [-s] [-r REVISION[:REVISION]]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-rm b/cg-rm\n--- a/cg-rm\n+++ b/cg-rm\n@@ -15,7 +15,7 @@ USAGE=\"cg-rm FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-rm FILE...\"\n+[ \"$1\" ] || usage\n \n rm -f \"$@\"\n git-update-cache --remove -- \"$@\"\ndiff --git a/cg-tag b/cg-tag\n--- a/cg-tag\n+++ b/cg-tag\n@@ -20,7 +20,7 @@ USAGE=\"cg-tag TAG [REVISION]\"\n name=$1\n id=$2\n \n-[ \"$name\" ] || die \"usage: cg-tag TNAME [COMMIT_ID]\"\n+[ \"$name\" ] || usage\n [ \"$id\" ] || id=$(commit-id)\n \n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\n-- \nJonas Fonseca\n"},{"id":"4248","messageId":"20050530084558.GE1036@pasky.ji.cz","threadId":"766","inReplyTo":"20050530030521.GA13232@diku.dk","subject":"Re: [PATCH] Cleanup cogito command usage reporting","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-30T08:45:58Z","receivedAt":"2005-05-30T08:45:58Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Mon, May 30, 2005 at 05:05:21AM CEST, I got a letter\nwhere Jonas Fonseca <fonseca@diku.dk> told me that...\n> [ Sorry for the resend. This should bring all usage strings in sync. I\n>   forgot to add the new options. ]\n> \n>  - Synchronize usage strings with those in cg-help. The command\n>    identifiers are still not as descriptive, though.\n\nOk, I'll focus on this point (the rest seems fine). I think it's\ninferior this way, since you are losing information, and for no benefit.\n\n> diff --git a/cg-clone b/cg-clone\n> --- a/cg-clone\n> +++ b/cg-clone\n> @@ -15,11 +15,12 @@\n> -USAGE=\"cg-clone [-s] LOCATION [<directory>]\"\n> +USAGE=\"cg-clone [-s] LOCATION [DESTINATION]\"\n> @@ -30,7 +31,7 @@ if [ \"$1\" = \"-s\" ]; then\n>  fi\n>  \n>  location=$1\n> -[ \"$location\" ] || die \"usage: cg-clone [-s] SOURCE_LOC [DESTDIR]\"\n> +[ \"$location\" ] || usage\n\nLOCATION -> SOURCE_LOC is fine in this context (if we would ever want\nDEST_LOC, it would be better to stick with SOURCE_LOC, though). But\nDESTDIR->DESTINATION is losing information. In cogito.txt you describe\nDESTINATION as a general target location, but it's really a directory\nhere. And it's shorter.\n\n> diff --git a/cg-export b/cg-export\n> --- a/cg-export\n> +++ b/cg-export\n> @@ -22,7 +22,7 @@ USAGE=\"cg-export DESTINATION [TREE]\"\n>  dest=$1\n>  id=$(tree-id $2)\n>  \n> -([ \"$dest\" ] && [ \"$id\" ]) || die \"usage: cg-export DEST [TREE_ID]\"\n> +([ \"$dest\" ] && [ \"$id\" ]) || usage\n\nI'm for DESTDIR here too, and what harm does the _ID part make here? I\nthink it's non-obvious otherwise - \"TREE\" can be understood as some\ndirectory name too.\n\n> diff --git a/cg-help b/cg-help\n> --- a/cg-help\n> +++ b/cg-help\n> @@ -43,7 +43,7 @@ Available commands:\n>  \tcg-export\tDEST [TREE_ID]\n>  \tcg-help\t\t[COMMAND]\n>  \tcg-init\n> -\tcg-log\t\t[-c] [-f] [-m] [-r FROM_ID[:TO_ID]] [FILE]...\n> +\tcg-log\t\t[-c] [-f] [-m] [-uUSERNAME] [-r FROM_ID[:TO_ID]] [FILE]...\n>  \tcg-ls\t\t[TREE_ID]\n>  \tcg-merge\t[-c] [-b BASE_ID] FROM_ID\n>  \tcg-mkpatch\t[-m] [-s] [-r FROM_ID[:TO_ID]]\n\nSo what about bringing those in sync too? (Or alternatively letting it\nbe now and build the output dynamically in another patch.)\n\n> diff --git a/cg-merge b/cg-merge\n> --- a/cg-merge\n> +++ b/cg-merge\n> @@ -38,11 +38,11 @@ fi\n>  base=\n>  if [ \"$1\" = \"-b\" ]; then\n>  \tshift\n> -\t[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n> +\t[ \"$1\" ] || usage\n\nI think BASE_ID->REVISION is loosing information too. What about\nBASE_COMMIT or something?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"4287","messageId":"20050531013644.GD13961@diku.dk","threadId":"766","inReplyTo":"20050530084558.GE1036@pasky.ji.cz","subject":"Re: [PATCH] Cleanup cogito command usage reporting","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-05-31T01:36:44Z","receivedAt":"2005-05-31T01:36:44Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Petr Baudis <pasky@ucw.cz> wrote Mon, May 30, 2005:\n> Dear diary, on Mon, May 30, 2005 at 05:05:21AM CEST, I got a letter\n> where Jonas Fonseca <fonseca@diku.dk> told me that...\n> > [ Sorry for the resend. This should bring all usage strings in sync. I\n> >   forgot to add the new options. ]\n> > \n> >  - Synchronize usage strings with those in cg-help. The command\n> >    identifiers are still not as descriptive, though.\n> \n> Ok, I'll focus on this point (the rest seems fine). I think it's\n> inferior this way, since you are losing information, and for no benefit.\n\nYes, I was thinking more about getting nice simple generic command\nidentifiers that was easy to describe than thinking about self\ndocumenting usage strings.\n\n> > diff --git a/cg-clone b/cg-clone\n> > --- a/cg-clone\n> > +++ b/cg-clone\n> > @@ -15,11 +15,12 @@\n> > -USAGE=\"cg-clone [-s] LOCATION [<directory>]\"\n> > +USAGE=\"cg-clone [-s] LOCATION [DESTINATION]\"\n> > @@ -30,7 +31,7 @@ if [ \"$1\" = \"-s\" ]; then\n> >  fi\n> >  \n> >  location=$1\n> > -[ \"$location\" ] || die \"usage: cg-clone [-s] SOURCE_LOC [DESTDIR]\"\n> > +[ \"$location\" ] || usage\n> \n> LOCATION -> SOURCE_LOC is fine in this context (if we would ever want\n> DEST_LOC, it would be better to stick with SOURCE_LOC, though). But\n> DESTDIR->DESTINATION is losing information. In cogito.txt you describe\n> DESTINATION as a general target location, but it's really a directory\n> here. And it's shorter.\n\nDone. Apart from the SOURCE_LOC.\n\n> > diff --git a/cg-export b/cg-export\n> > --- a/cg-export\n> > +++ b/cg-export\n> > @@ -22,7 +22,7 @@ USAGE=\"cg-export DESTINATION [TREE]\"\n> >  dest=$1\n> >  id=$(tree-id $2)\n> >  \n> > -([ \"$dest\" ] && [ \"$id\" ]) || die \"usage: cg-export DEST [TREE_ID]\"\n> > +([ \"$dest\" ] && [ \"$id\" ]) || usage\n> \n> I'm for DESTDIR here too, and what harm does the _ID part make here? I\n> think it's non-obvious otherwise - \"TREE\" can be understood as some\n> directory name too.\n\nTREE_ID it is and then DESTFILE (since it expects *.tar.* argument).\n\n> > diff --git a/cg-help b/cg-help\n> > --- a/cg-help\n> > +++ b/cg-help\n> > @@ -43,7 +43,7 @@ Available commands:\n> >  \tcg-export\tDEST [TREE_ID]\n> >  \tcg-help\t\t[COMMAND]\n> >  \tcg-init\n> > -\tcg-log\t\t[-c] [-f] [-m] [-r FROM_ID[:TO_ID]] [FILE]...\n> > +\tcg-log\t\t[-c] [-f] [-m] [-uUSERNAME] [-r FROM_ID[:TO_ID]] [FILE]...\n> >  \tcg-ls\t\t[TREE_ID]\n> >  \tcg-merge\t[-c] [-b BASE_ID] FROM_ID\n> >  \tcg-mkpatch\t[-m] [-s] [-r FROM_ID[:TO_ID]]\n> \n> So what about bringing those in sync too? (Or alternatively letting it\n> be now and build the output dynamically in another patch.)\n\nDropped.\n\n> > diff --git a/cg-merge b/cg-merge\n> > --- a/cg-merge\n> > +++ b/cg-merge\n> > @@ -38,11 +38,11 @@ fi\n> >  base=\n> >  if [ \"$1\" = \"-b\" ]; then\n> >  \tshift\n> > -\t[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n> > +\t[ \"$1\" ] || usage\n> \n> I think BASE_ID->REVISION is loosing information too. What about\n> BASE_COMMIT or something?\n\nChanged to BASE_COMMIT.\n\n===\nCleanup USAGE strings to be more self-documenting like those listed in\ncg-help but with the following changes:\n\n\tBNAME\t-> BRANCHNAME\n\tTNAME\t-> TAGNAME\n\tOBJTYPE\t-> OBJECT_TYPE\n\nUpdated the cogito manpage to reflect the change of command identifiers.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n\n Documentation/make-cogito-asciidoc |   16 +++++++---------\n cg-Xlib                            |    3 +++\n cg-add                             |    2 +-\n cg-admin-lsobj                     |    2 +-\n cg-admin-uncommit                  |    2 +-\n cg-branch-add                      |    4 ++--\n cg-clone                           |    5 +++--\n cg-commit                          |    4 ++--\n cg-diff                            |    4 ++--\n cg-export                          |    4 ++--\n cg-help                            |    2 +-\n cg-log                             |    4 ++--\n cg-ls                              |    2 +-\n cg-merge                           |    8 ++++----\n cg-mkpatch                         |    4 ++--\n cg-pull                            |    2 +-\n cg-rm                              |    2 +-\n cg-seek                            |    2 +-\n cg-tag                             |    4 ++--\n cg-update                          |    2 +-\n 20 files changed, 40 insertions(+), 38 deletions(-)\n\ndiff --git a/Documentation/make-cogito-asciidoc b/Documentation/make-cogito-asciidoc\n--- a/Documentation/make-cogito-asciidoc\n+++ b/Documentation/make-cogito-asciidoc\n@@ -106,20 +106,17 @@ $(print_command_listing $HELPER_COMMANDS\n \n Command Identifiers\n -------------------\n-BRANCH::\n-\tIndicates a branch name added with the $(link cg-branch-add) name.\n+BRANCH_NAME::\n+\tIndicates a branch name added with the $(link cg-branch-add) command.\n \n COMMAND::\n \tIndicates a 'Cogito' command. The \\`cg-\\` prefix is optional.\n \n-DESTINATION::\n-\tIndicates a path to a location file.\n-\n LOCATION::\n \tIndicates a local file path or a URI. See $(link cg-branch-add) for a\n \tlist of supported URI schemes.\n \n-REVISION::\n+COMMIT_ID, FROM_ID, TO_ID, BASE_COMMIT::\n \tIndicates an ID resolving to a commit. The following expressions can\n \tbe used interchangably as IDs:\n \t- empty string, 'this' or 'HEAD' (current HEAD)\n@@ -129,17 +126,18 @@ REVISION::\n \t- commit object hash (as returned by 'commit-id')\n \t- tree object hash (as returned by 'tree-id')\n \n-TAG::\n+TAG_NAME::\n \tIndicates a free form tag name.\n \n-TYPE::\n+OBJECT_TYPE::\n \tIndicates a git object type i.e.: 'blob', 'commit', 'tree' or 'tag'.\n \n USERNAME::\n \tIndicates a free form user name.\n \n FILE::\n-\tIndicates a filename - always relative to the root of the repository.\n+\tIndicates an already existing filename - always relative to the root\n+\tof the repository.\n \n COPYRIGHT\n ---------\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -17,6 +17,9 @@ die () {\n \texit 1\n }\n \n+usage() {\n+\tdie \"usage: $USAGE\"\n+}\n \n mktemp () {\n \tif [ ! \"$BROKEN_MKTEMP\" ]; then\ndiff --git a/cg-add b/cg-add\n--- a/cg-add\n+++ b/cg-add\n@@ -17,7 +17,7 @@ USAGE=\"cg-add FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-add FILE...\"\n+[ \"$1\" ] || usage\n \n TMPFILE=$(mktemp -t gitadd.XXXXXX)\n find \"$@\" -type f > $TMPFILE || die \"not all files exist, nothing added\"\ndiff --git a/cg-admin-lsobj b/cg-admin-lsobj\n--- a/cg-admin-lsobj\n+++ b/cg-admin-lsobj\n@@ -35,7 +35,7 @@\n #\t\techo -e \"\\n==================\\nme $i\"; cat-file commit $i;\n #\tdone\n \n-USAGE=\"cg-admin-lsobj [TYPE]\"\n+USAGE=\"cg-admin-lsobj [OBJECT_TYPE]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-admin-uncommit b/cg-admin-uncommit\n--- a/cg-admin-uncommit\n+++ b/cg-admin-uncommit\n@@ -17,7 +17,7 @@\n #\ttherefore generating tree with local changes against the target\n #\tcommit, consisting of the changes in the rolled back commits.\n \n-USAGE=\"cg-admin-uncommit [-t] [REVISION]\"\n+USAGE=\"cg-admin-uncommit [-t] [COMMIT_ID]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-branch-add b/cg-branch-add\n--- a/cg-branch-add\n+++ b/cg-branch-add\n@@ -30,14 +30,14 @@\n #\n # and refer to it as 'repo-testing' anytime later.\n \n-USAGE=\"cg-branch-add BRANCH LOCATION\"\n+USAGE=\"cg-branch-add BRANCH_NAME LOCATION\"\n \n . ${COGITO_LIB}cg-Xlib\n \n name=$1\n location=$2\n \n-([ \"$name\" ] && [ \"$location\" ]) || die \"usage: cg-branch-add NAME SOURCE_LOC\"\n+([ \"$name\" ] && [ \"$location\" ]) || usage\n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\n \tdie \"name contains invalid characters\"\n if [ \"$name\" = \"this\" ] || [ \"$name\" = \"HEAD\" ]; then\ndiff --git a/cg-clone b/cg-clone\n--- a/cg-clone\n+++ b/cg-clone\n@@ -15,8 +15,9 @@\n # -------\n # -s::\n #\tClone in the current directory instead of creating a new one.\n+#\tSpecifying both -s and a desination directory makes no sense .\n \n-USAGE=\"cg-clone [-s] LOCATION [<directory>]\"\n+USAGE=\"cg-clone [-s] LOCATION [DESTDIR]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n@@ -27,7 +28,7 @@ if [ \"$1\" = \"-s\" ]; then\n fi\n \n location=$1\n-[ \"$location\" ] || die \"usage: cg-clone [-s] SOURCE_LOC [DESTDIR]\"\n+[ \"$location\" ] || usage\n location=${location%/}\n \n destdir=$2\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -20,7 +20,7 @@\n #\tNote, this is used internally by Cogito when merging. This option\n #\tdoes not make sense when files are given on the command line.\n #\n-# -m<message>::\n+# -mMESSAGE::\n #\tSpecify the commit message, which is used instead of starting\n #\tup an editor (if the input is not `stdin`, the input is appended\n #\tafter all the '-m' messages). Multiple '-m' parameters are appended\n@@ -72,7 +72,7 @@\n # EDITOR::\n #\tThe editor used for entering revision log information.\n \n-USAGE=\"cg-commit [-m<message>]... [-C] [-e | -E] [FILE]...\"\n+USAGE=\"cg-commit [-mMESSAGE]... [-C] [-e | -E] [FILE]...\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-diff b/cg-diff\n--- a/cg-diff\n+++ b/cg-diff\n@@ -16,7 +16,7 @@\n #\tInstead of one ID denotes a parent commit to the specified ID\n #\t(which must not be a tree, obviously).\n #\n-# -r REVISION[:REVISION]::\n+# -r FROM_ID[:TO_ID]::\n #\tSpecify the revisions to diff using either '-r rev1:rev2' or\n #\t'-r rev1 -r rev2'. If no revision is specified, the current\n #\tworking tree is implied. Note that no revision is different from\n@@ -27,7 +27,7 @@\n #\tBase the diff at the merge base of the -r arguments (defaulting\n #\tto master and origin).\n \n-USAGE=\"cg-diff [-p] [-r REVISION[:REVISION]] [FILE]...\"\n+USAGE=\"cg-diff [-c] [-m] [-p] [-r FROM_ID[:TO_ID] [FILE]...\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-export b/cg-export\n--- a/cg-export\n+++ b/cg-export\n@@ -10,14 +10,14 @@\n # for generating a tarball. Other destination specifiers are assumed\n # to be directory names, and the tree is exported to the given directory.\n \n-USAGE=\"cg-export DESTINATION [TREE]\"\n+USAGE=\"cg-export DESTFILE [TREE_ID]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n dest=$1\n id=$(tree-id $2)\n \n-([ \"$dest\" ] && [ \"$id\" ]) || die \"usage: cg-export DEST [TREE_ID]\"\n+([ \"$dest\" ] && [ \"$id\" ]) || usage\n \n [ -e \"$dest\" ] && die \"$dest already exists.\"\n \ndiff --git a/cg-log b/cg-log\n--- a/cg-log\n+++ b/cg-log\n@@ -24,7 +24,7 @@\n # -f::\n #\tList affected files.\n #\n-# -r REVISION[:REVISION]::\n+# -r FROM_ID[:TO_ID]::\n #\tLimit the log information to a set of revisions using either\n #\t'-r FROM_ID[:TO_ID]' or '-r FROM_ID -r TO_ID'. In both cases the\n #\toption expects IDs which resolve to commits and will include the\n@@ -55,7 +55,7 @@\n #\n #\t$ cg-log -r releasetag-0.9:releasetag-0.10\n \n-USAGE=\"cg-log [-c] [-f] [-uUSERNAME] [-r REVISION[:REVISION]] FILE...\"\n+USAGE=\"cg-log [-c] [-f] [m] [-uUSERNAME] [-r FROM_ID[:TO_ID] FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n # Try to fix the annoying \"Broken pipe\" output. May not help, but apparently\ndiff --git a/cg-ls b/cg-ls\n--- a/cg-ls\n+++ b/cg-ls\n@@ -29,7 +29,7 @@\n #\n #\t100644  blob    c7dacd0ea28994e3c754ca4eadb2e08c011ee3d3        README\n \n-USAGE=\"cg-ls [TREE]\"\n+USAGE=\"cg-ls [TREE_ID]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-merge b/cg-merge\n--- a/cg-merge\n+++ b/cg-merge\n@@ -12,14 +12,14 @@\n #\n # OPTIONS\n # -------\n-# -b REVISION::\n+# -b BASE_COMMIT::\n #\tParameter specifies the base commit for the merge.\n #\n # -c::\n #\tParameter specifies that you want to have tree merge never\n #\tautocomitted, but want to review and commit it manually.\n \n-USAGE=\"cg-merge [-c] [-b REVISION] BRANCH\"\n+USAGE=\"cg-merge [-c] [-b BASE_COMMIT] BRANCH_NAME\"\n \n . ${COGITO_LIB}cg-Xlib\n \n@@ -35,11 +35,11 @@ fi\n base=\n if [ \"$1\" = \"-b\" ]; then\n \tshift\n-\t[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+\t[ \"$1\" ] || usage\n \tbase=$(commit-id \"$1\") || exit 1; shift\n fi\n \n-[ \"$1\" ] || die \"usage: cg-merge [-c] [-b BASE_ID] FROM_ID\"\n+[ \"$1\" ] || usage\n branchname=\"$1\"\n branch=$(commit-id \"$branchname\") || exit 1\n \ndiff --git a/cg-mkpatch b/cg-mkpatch\n--- a/cg-mkpatch\n+++ b/cg-mkpatch\n@@ -11,7 +11,7 @@\n #\tSpecify whether to print a short version of the patch without\n #\ta patch header with meta info such as author and committer.\n #\n-# -r REVISION[:REVISION]::\n+# -r FROM_ID[:TO_ID]::\n #\tSpecify a set of commits to make patches from using either\n #\t'-r FROM_ID[:TO_ID]' or '-r FROM_ID -r TO_ID'. In both cases the\n #\toption expects IDs which resolve to commits and will include the\n@@ -34,7 +34,7 @@\n # the line\n # `!-------------------------------------------------------------flip-`\n \n-USAGE=\"cg-mkpatch [-s] [-r REVISION[:REVISION]]\"\n+USAGE=\"cg-mkpatch [-m] [-s] [-r FROM_ID[:TO_ID]]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-pull b/cg-pull\n--- a/cg-pull\n+++ b/cg-pull\n@@ -7,7 +7,7 @@\n #\n # See `cg-branch-add` for some description.\n \n-USAGE=\"cg-pull [BRANCH]\"\n+USAGE=\"cg-pull [BRANCH_NAME]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-rm b/cg-rm\n--- a/cg-rm\n+++ b/cg-rm\n@@ -10,7 +10,7 @@ USAGE=\"cg-rm FILE...\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-[ \"$1\" ] || die \"usage: cg-rm FILE...\"\n+[ \"$1\" ] || usage\n \n rm -f \"$@\"\n git-update-cache --remove -- \"$@\"\ndiff --git a/cg-seek b/cg-seek\n--- a/cg-seek\n+++ b/cg-seek\n@@ -19,7 +19,7 @@\n # the right thing too. If you want to migrate your working tree to another\n # branch, use `cg-clone`.\n \n-USAGE=\"cg-seek REVISION\"\n+USAGE=\"cg-seek [COMMIT_ID]\"\n \n . ${COGITO_LIB}cg-Xlib\n \ndiff --git a/cg-tag b/cg-tag\n--- a/cg-tag\n+++ b/cg-tag\n@@ -8,14 +8,14 @@\n #\n # Takes the tag name and optionally the associated ID as arguments.\n \n-USAGE=\"cg-tag TAG [REVISION]\"\n+USAGE=\"cg-tag TAG_NAME [COMMIT_ID]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n name=$1\n id=$2\n \n-[ \"$name\" ] || die \"usage: cg-tag TNAME [COMMIT_ID]\"\n+[ \"$name\" ] || usage\n [ \"$id\" ] || id=$(commit-id)\n \n (echo $name | egrep -qv '[^a-zA-Z0-9_.@!:-]') || \\\ndiff --git a/cg-update b/cg-update\n--- a/cg-update\n+++ b/cg-update\n@@ -8,7 +8,7 @@\n # If local changes conflict with those of the branch updated from the\n # merge will be blocked.\n \n-USAGE=\"cg-update [BRANCH]\"\n+USAGE=\"cg-update [BRANCH_NAME]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n-- \nJonas Fonseca\n"}]}