git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH RFC 1/8] reintroduce PUSH_DEFAULT_UNSPECIFIED

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jul 20, 2009, 17:49 UTC
Message-ID
<1248112195-3761-2-git-send-email-bonzini@gnu.org>
In-Reply-To
<1248112195-3761-1-git-send-email-bonzini@gnu.org>

This is just the first patch from the push --current series. It is the only one needed as a prerequisite for these patches, at least to get as far as writing the configuration in .git/config.

Not-signed-off-for-this-rfc-by: Paolo Bonzini <bonzini@gnu.org>
---
 builtin-push.c |    1 +
 cache.h        |    1 +
 environment.c  |    2 +-
 3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/builtin-push.c b/builtin-push.c
index 1d92e22..e678a9d 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -69,6 +69,7 @@ static void setup_default_push_refspecs(void)
 	git_config(git_default_config, NULL);
 	switch (push_default) {
 	default:
+	case PUSH_DEFAULT_UNSPECIFIED:
 	case PUSH_DEFAULT_MATCHING:
 		add_refspec(":");
 		break;
diff --git a/cache.h b/cache.h
index dbe460c..f10513f 100644
--- a/cache.h
+++ b/cache.h
@@ -544,6 +544,7 @@ enum rebase_setup_type {
 };
 
 enum push_default_type {
+	PUSH_DEFAULT_UNSPECIFIED = -1,
 	PUSH_DEFAULT_NOTHING = 0,
 	PUSH_DEFAULT_MATCHING,
 	PUSH_DEFAULT_TRACKING,
diff --git a/environment.c b/environment.c
index 95aa8a6..4b68109 100644
--- a/environment.c
+++ b/environment.c
@@ -46,7 +46,7 @@ struct tracking_config git_branch_track = {
 	AUTOREBASE_NEVER,
 	0
 };
-enum push_default_type push_default = PUSH_DEFAULT_MATCHING;
+enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED;
 #ifndef OBJECT_CREATION_MODE
 #define OBJECT_CREATION_MODE OBJECT_CREATION_USES_HARDLINKS
 #endif
-- 
1.6.2.5
Previous: Paolo BonziniNext: Paolo Bonzini
Message 2 of 16 in “introduce 'git remote add --push' and 'git clone --push'”
  1. 0/8 introduce 'git remote add --push' and 'git clone --push'Paolo Bonzini, Jul 20, 2009
  2. 1/8 reintroduce PUSH_DEFAULT_UNSPECIFIEDPaolo Bonzini, Jul 20, 2009
  3. 2/8 push: add push.default = mirrorPaolo Bonzini, Jul 20, 2009
  4. Junio C HamanoJul 20, 2009
  5. Paolo BonziniJul 20, 2009
  6. Junio C HamanoJul 20, 2009
  7. Paolo BonziniJul 20, 2009
  8. 3/8 git remote add: refactor configurationPaolo Bonzini, Jul 20, 2009
  9. 4/8 git remote add: add --push optionPaolo Bonzini, Jul 20, 2009
  10. 5/8 clone: refactoring of building the fetch refspecPaolo Bonzini, Jul 20, 2009
  11. 6/8 clone: use setup_remote_configPaolo Bonzini, Jul 20, 2009
  12. 7/8 config: add git_config_norepoPaolo Bonzini, Jul 20, 2009
  13. 8/8 clone: add --push optionPaolo Bonzini, Jul 20, 2009
  14. Junio C HamanoJul 20, 2009
  15. Paolo BonziniJul 21, 2009
  16. Junio C HamanoJul 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.