{"thread":{"id":"15812","subject":"[PATCH] git-push.txt: Describe --repo option in more detail","startedAt":"2008-10-07T14:26:20Z","lastAt":"2008-10-07T14:26:20Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92528","messageId":"48EB718C.9060402@viscovery.net","threadId":"15812","inReplyTo":null,"subject":"[PATCH] git-push.txt: Describe --repo option in more detail","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-10-07T14:26:20Z","receivedAt":"2008-10-07T14:26:20Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <johannes.sixt@telecom.at>\n\nThe --repo option was described in a way that the reader would have to\nassume that it is the same as the <repository> parameter. But it actually\nservers a purpose, which is now written down.\n\nFurthermore, the --mirror option was missing from the synopsis.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n I do not have the toolchain to format the documentation, so please take\n this with a grain of salt.\n\n -- Hannes\n\n Documentation/git-push.txt |   24 +++++++++++++++++++-----\n builtin-push.c             |    2 +-\n 2 files changed, 20 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-push.txt b/Documentation/git-push.txt\nindex 45c9643..6150b1b 100644\n--- a/Documentation/git-push.txt\n+++ b/Documentation/git-push.txt\n@@ -9,8 +9,8 @@ git-push - Update remote refs along with associated objects\n SYNOPSIS\n --------\n [verse]\n-'git push' [--all] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]\n-\t   [--repo=all] [-f | --force] [-v | --verbose]\n+'git push' [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>]\n+\t   [--repo=<repository>] [-f | --force] [-v | --verbose]\n \t   [<repository> <refspec>...]\n\n DESCRIPTION\n@@ -101,9 +101,23 @@ nor in any Push line of the corresponding remotes file---see below).\n \tThis flag disables the check.  This can cause the\n \tremote repository to lose commits; use it with care.\n\n---repo=<repo>::\n-\tWhen no repository is specified the command defaults to\n-\t\"origin\"; this overrides it.\n+--repo=<repository>::\n+\tThis option is only relevant if no <repository> argument is\n+\tpassed in the invocation. In this case, 'git-push' derives the\n+\tremote name from the current branch: If it tracks a remote\n+\tbranch, then that remote repository is pushed to. Otherwise,\n+\tthe name \"origin\" is used. For this latter case, this option\n+\tcan be used to override the name \"origin\". In other words,\n+\tthe difference between these two commands\n++\n+--------------------------\n+git push public         #1\n+git push --repo=public  #2\n+--------------------------\n++\n+is that #1 always pushes to \"public\" whereas #2 pushes to \"public\"\n+only if the current branch does not track a remote branch. This is\n+useful if you write an alias or script around 'git-push'.\n\n --thin::\n --no-thin::\ndiff --git a/builtin-push.c b/builtin-push.c\nindex cc6666f..122fdcf 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -10,7 +10,7 @@\n #include \"parse-options.h\"\n\n static const char * const push_usage[] = {\n-\t\"git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=all] [-f | --force] [-v] [<repository> <refspec>...]\",\n+\t\"git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]\",\n \tNULL,\n };\n\n-- \n1.6.0.2.651.gd07df\n"}]}