All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Default remote
@ 2012-07-11 15:33 marcnarc
  2012-07-11 15:33 ` [PATCH 1/6] Rename remote.c's default_remote_name static variables marcnarc
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: marcnarc @ 2012-07-11 15:33 UTC (permalink / raw)
  To: git; +Cc: gitster, Jens.Lehmann, peff, phil.hord

Incorporated feedback on the first version of this series[1], and also added
documentation updates.

Note that the documentation changes include 4 minor grammatical fixes (verb
tenses, added a "the" in a couple fo places).  

I also added Phil's "git push" scenario to patch #2's message, rather than
putting it in the documentation as I'd planned.  Explaining the behavior
change in the commit message felt more natural.

The specific differences from v1 are:

Patch #1 (Rename remote.c's default_remote_name static variables.):
  * Expanded the commit message to explain the choice of
    "effective_remote_name".

Patch #2 (Teach remote.c about the remote.default configuration setting.):
  * Added documentation updates.
  * Commit message now describes change in default "git push" behavior.
  * Moved new remote_get_default_name() and remote_count() functions
    to patch #3.

Patch #3 (Teach "git remote" about remote.default.):
  * (Was patch #4 in v1 of this series.)
  * Documented changes to "git remote".
  * The remote_get_default_name() and remote_count() functions are
    now added to remote.[ch] here, with proper declarations.
  * Added a test to ensure that renaming the "origin" remote still
    properly sets remote.default in repos created with an older
    version of git.

Patch #4 (Teach clone to set remote.default.):
  * (Was patch #3 in v1 of this series.)
  * Commit message now justifies changes to "git clone".

Patches 5 & 6 are unchanged.

		M.

[1] http://thread.gmane.org/gmane.comp.version-control.git/201065

Marc Branchaud (6):
      Rename remote.c's default_remote_name static variables.
      Teach remote.c about the remote.default configuration setting.
      Teach "git remote" about remote.default.
      Teach clone to set remote.default.
      Test that plain "git fetch" uses remote.default when on a detached HEAD.
      Teach get_default_remote to respect remote.default.

 Documentation/config.txt           |  8 ++++
 Documentation/git-pull.txt         |  6 ++-
 Documentation/git-push.txt         |  8 +++-
 Documentation/git-remote.txt       | 32 ++++++++++++++--
 Documentation/pull-fetch-param.txt |  6 +++
 builtin/clone.c                    |  2 +
 builtin/remote.c                   | 29 +++++++++++++++
 git-parse-remote.sh                |  5 +--
 remote.c                           | 34 +++++++++++++----
 remote.h                           |  2 +
 t/t5505-remote.sh                  | 76 ++++++++++++++++++++++++++++++++++++++
 t/t5510-fetch.sh                   | 17 +++++++++
 t/t5512-ls-remote.sh               |  8 +++-
 t/t5528-push-default.sh            |  4 +-
 t/t5601-clone.sh                   | 10 +++++
 t/t5702-clone-options.sh           |  7 +++-
 t/t7400-submodule-basic.sh         | 21 +++++++++++
 17 files changed, 253 insertions(+), 22 deletions(-)

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/6] Default remote
@ 2012-07-05 22:11 marcnarc
  2012-07-05 22:11 ` [PATCH 6/6] Teach get_default_remote to respect remote.default marcnarc
  0 siblings, 1 reply; 18+ messages in thread
From: marcnarc @ 2012-07-05 22:11 UTC (permalink / raw)
  To: git; +Cc: gitster, Jens.Lehmann, peff, phil.hord

This series is a follow-up to an earlier patch and discussion[1] that
suggested adding a remote.default setting.

The first patch simply renames a couple of variables in remote.c so that
the second patch is easier to understand.

The second patch teaches remote.c to look for remote.default in the config:

 - When deciding which remote to use, the code first tries the currently
   checked-out branch's remote.  If there isn't one it tries remote.default,
   and if that also fails it falls back to "origin".

 - The patch also adds a couple of helper functions for other code to use:
   remote_get_default_name() and remote_count().  remote_get_default_name()
   returns the value of remote.default, or "origin" if it's not configured
   (this preserves existing behavior).  remote_count() is used in patch
   four by "git remote add".

The third patch teaches "git clone" to set remote.default.

The fourth patch teaches "git remote" about remote.default.  In addition to
modifying the existing "add" "rm" and "rename" commands, it also adds a new
"git remote default" command to get/set remote.default.  The advantage of this
over just using "git config" directly is twofold:

 - "git remote default foo" checks that foo is a configured remote.

 - "git remote default" (with no parameter) returns "origin" if 
   remote.default isn't configured.

Note that this patch changes the way push.default=matching works when the
currently checked-out branch has no remote.  Before "git push" would error out
with "No configured push destination" but now it succeeds with "Everything
up-to-date".  I personally think this is a good thing.

The fifth patch just adds a test that plain "git fetch" respects
remote.default when on remoteless branch.  I suppose it could be squashed into
patch four, but it's really more of a side-effect of that work and not
strictly required by it.  So I felt patch four would be more understandable
without it.

The sixth patch changes git-parse-remote.sh:get_default_remote() to use
"git remote default" instead of implementing its own default-finding logic.
Because "git remote default" returns "origin" when no remote.default is
configured, this change preserves the old behavior in existing repos.  The
test accompanying this patch essentially tests the same condition that
inspired the original discussion[1].  (git-submodule is pretty much the only
thing that uses get_default_remote().)

This series still needs documentation updates, which I'll do if/when we
agree on the code changes.

		M.

[1] http://article.gmane.org/gmane.comp.version-control.git/200145

Marc Branchaud (6):
      Rename remote.c's default_remote_name static variables.
      Teach remote.c about the remote.default configuration setting.
      Teach clone to set remote.default.
      Teach "git remote" about remote.default.
      Test that plain "git fetch" uses remote.default when on a detached HEAD.
      Teach get_default_remote to respect remote.default.

 builtin/clone.c            |  2 ++
 builtin/remote.c           | 29 +++++++++++++++++++++
 git-parse-remote.sh        |  5 +---
 remote.c                   | 35 ++++++++++++++++++++-----
 remote.h                   |  2 ++
 t/t5505-remote.sh          | 64 ++++++++++++++++++++++++++++++++++++++++++++++
 t/t5510-fetch.sh           | 17 ++++++++++++
 t/t5512-ls-remote.sh       |  8 +++++-
 t/t5528-push-default.sh    |  4 +--
 t/t5601-clone.sh           | 10 ++++++++
 t/t5702-clone-options.sh   |  7 +++--
 t/t7400-submodule-basic.sh | 21 +++++++++++++++
 12 files changed, 188 insertions(+), 16 deletions(-)

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

end of thread, other threads:[~2012-07-13 20:29 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-11 15:33 [PATCH v2 0/6] Default remote marcnarc
2012-07-11 15:33 ` [PATCH 1/6] Rename remote.c's default_remote_name static variables marcnarc
2012-07-11 15:33 ` [PATCH 2/6] Teach remote.c about the remote.default configuration setting marcnarc
2012-07-11 18:21   ` Junio C Hamano
2012-07-11 20:41     ` Marc Branchaud
2012-07-11 22:04       ` Junio C Hamano
2012-07-13 19:37         ` Marc Branchaud
2012-07-13 20:29           ` Junio C Hamano
2012-07-11 15:33 ` [PATCH 3/6] Teach "git remote" about remote.default marcnarc
2012-07-11 18:27   ` Junio C Hamano
2012-07-11 20:41     ` Marc Branchaud
2012-07-11 21:55       ` Junio C Hamano
2012-07-13 19:54         ` Marc Branchaud
2012-07-11 15:33 ` [PATCH 4/6] Teach clone to set remote.default marcnarc
2012-07-11 15:34 ` [PATCH 5/6] Test that plain "git fetch" uses remote.default when on a detached HEAD marcnarc
2012-07-11 15:34 ` [PATCH 6/6] Teach get_default_remote to respect remote.default marcnarc
2012-07-11 18:19 ` [PATCH v2 0/6] Default remote Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2012-07-05 22:11 [PATCH " marcnarc
2012-07-05 22:11 ` [PATCH 6/6] Teach get_default_remote to respect remote.default marcnarc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.