Skip to contentSkip to conversation

GSoC 2015: 2 accepted proposals

PATCH In review Matthieu Moy 5 participants 13 messages Jun 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

The results just got offical: the Git organization has 2 students accepted for the summer of code 2015.

Karthik Nayak will work on "Unifying git branch -l, git tag -l, and git for-each-ref" mentored by Christian Couder and yours truly.

Paul Tan will work on "Make git-pull and git-am builtins", mentored by Johannes Schindelin and Stefan Beller.

Regards,

Signature · 2 lines
Matthieu Moy
http://www-verimag.imag.fr/~moy/
#1 lore raw

Hello to Everyone,

Quoted 7 lines · Matthieu Moy

Hi,

The results just got offical: the Git organization has 2 students accepted for the summer of code 2015.

Karthik Nayak will work on "Unifying git branch -l, git tag -l, and git for-each-ref" mentored by Christian Couder and yours truly.

Thanks a lot for accepting my proposal and giving me an opportunity to work with Git via GSoC. Can't express how excited I am.

As Matthieu mentioned I will be working on "Unifying git branch -l, git tag -l, and git for-each-ref". I plan to start off by going through the existing implementation of each of the above commands and come up with a design for unification for now. Also to take notes from Jeff King's attempt at unification[1].

I will be pushing all my work to my personal Git repository on Github[2].
Where anyone can get involved. Will also make sure to notify the mailing list on a regular basis on what is going on with my project.

Looking forward to work with Git and complete this project successfully.

Regards,
Karthik

Quoted 3 lines

Paul Tan will work on "Make git-pull and git-am builtins", mentored by Johannes Schindelin and Stefan Beller.

Congrats Paul, I wish you the very best.

Quoted 3 lines

Regards,

[1] https://github.com/peff/git/tree/jk/for-each-ref-contains-wip
[2] https://github.com/KarthikNayak/git

#2 lore raw
In reply to Matthieu Moy

Hi all,

Quoted 10 lines · Matthieu Moy

Hi,

The results just got offical: the Git organization has 2 students accepted for the summer of code 2015.

Karthik Nayak will work on "Unifying git branch -l, git tag -l, and git for-each-ref" mentored by Christian Couder and yours truly.

Paul Tan will work on "Make git-pull and git-am builtins", mentored by Johannes Schindelin and Stefan Beller.

Thanks for accepting me, and it is my pleasure to work with everyone. For reference, information on the proposed project can be found at [1].

As stated in the proposal, I will be starting work on the project immediately. The first step would be to review the test coverage of git-pull and git-am in order to make sure that nothing breaks during the rewriting. I am currently reviewing all related code in order to get a better perspective on the issues involved. I am also aware of the recent issues with git-pull[2], which I will look into.

All patches that I'm working on but are not ready to be published to the mailing list will be cooked in their corresponding branches in my personal git repo[3], which I will push at least once a working day. Everyone is welcome to have a look :-).

Again, thanks all for your support and guidance, and I look forward to working with everyone to make this project a success.

Regards,
Paul

[1] https://gist.github.com/pyokagan/1b7b0d1f4dab6ba3cef1
[2] http://thread.gmane.org/gmane.comp.version-control.git/267432
[3] https://github.com/pyokagan/git

#3 lore raw

Hi Paul,

Quoted 7 lines · Paul Tan

As stated in the proposal, I will be starting work on the project immediately. The first step would be to review the test coverage of git-pull and git-am in order to make sure that nothing breaks during the rewriting. I am currently reviewing all related code in order to get a better perspective on the issues involved. I am also aware of the recent issues with git-pull[2], which I will look into.

Quoted 7 lines

All patches that I'm working on but are not ready to be published to the mailing list will be cooked in their corresponding branches in my personal git repo[3], which I will push at least once a working day. Everyone is welcome to have a look :-).

Again, thanks all for your support and guidance, and I look forward to working with everyone to make this project a success.

Sounds good! Feel free to ping me on https://gitter.im/git-for-windows/git for a more interactive chat. Email is fine with me, too, though.

Ciao,
Johannes

#4 lore raw

cover Make pull a builtin

In reply to Paul Tan

Hi Paul,

Congratulations on getting your project accepted for GSOC. Here's my attempt at implementing pull as a builtin, maybe it will be of some use as you look to progress your version.

It's fairly complete in the sense that all the features of git-pull.sh should be implemented, the test suite passes, and I've been using it myself without issue. At the same time it's some way from finished as I've never had time to test it fully and there are parts of the code I'm not happy with.

Apologies for not sharing this with you earlier. I have been too busy with paid work to look at any open source projects for some months.

Good luck with your project!

Regards
Stephen

Stephen Robin (6):
merge: tidy up options
merge: move error message given when a merge needs committing to
advice.c
merge-base: split handle_fork_point to make reuse easier
pull: reimplement as a builtin in C
pull: allow interactive rebase
parse-remote: dismantle git-parse-remote.sh

 .gitignore                           |    2 -
 Documentation/config.txt             |    1 +
 Documentation/git-parse-remote.txt   |   23 -
 Documentation/git-pull.txt           |    4 +-
 Makefile                             |    3 +-
 advice.c                             |    9 +
 advice.h                             |    1 +
 builtin.h                            |    3 +
 builtin/merge-base.c                 |   64 ++-
 builtin/merge.c                      |   16 +-
 builtin/pull.c                       | 1006 ++++++++++++++++++++++++++++++++++
 builtin/remote.c                     |    8 +-
 command-list.txt                     |    1 -
 contrib/examples/git-parse-remote.sh |   89 +++
 contrib/examples/git-pull.sh         |  340 ++++++++++++
 git-parse-remote.sh                  |   89 ---
 git-pull.sh                          |  340 ------------
 git-rebase.sh                        |   36 +-
 git-submodule.sh                     |    8 +-
 git.c                                |    1 +
 20 files changed, 1547 insertions(+), 497 deletions(-)
 delete mode 100644 Documentation/git-parse-remote.txt
 create mode 100644 builtin/pull.c
 create mode 100644 contrib/examples/git-parse-remote.sh
 create mode 100755 contrib/examples/git-pull.sh
 delete mode 100644 git-parse-remote.sh
 delete mode 100755 git-pull.sh
Signature · 1 line
2.4.0.7.gf20f26f
#5 lore raw

PATCH 1/6 merge: tidy up options

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

Hide --summary (it is a deprecated synonym for --stat). Correct capitalization of the description of --verify-signatures. Correct indentation of code.

---
 builtin/merge.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
builtin/merge.c +5 -5
index 3b0f8f9..d6b0579 100644
@@ -194,10 +194,10 @@ static struct option builtin_merge_options[] = {
 		PARSE_OPT_NOARG, option_parse_n },
 	OPT_BOOL(0, "stat", &show_diffstat,
 		N_("show a diffstat at the end of the merge")),
-	OPT_BOOL(0, "summary", &show_diffstat, N_("(synonym to --stat)")),
+	OPT_HIDDEN_BOOL(0, "summary", &show_diffstat, N_("(synonym to --stat)")),
 	{ OPTION_INTEGER, 0, "log", &shortlog_len, N_("n"),
-	  N_("add (at most <n>) entries from shortlog to merge commit message"),
-	  PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
+		N_("add (at most <n>) entries from shortlog to merge commit message"),
+		PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN },
 	OPT_BOOL(0, "squash", &squash,
 		N_("create a single commit instead of doing a merge")),
 	OPT_BOOL(0, "commit", &option_commit,
@@ -210,7 +210,7 @@ static struct option builtin_merge_options[] = {
 		PARSE_OPT_NOARG | PARSE_OPT_NONEG, NULL, FF_ONLY },
 	OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
 	OPT_BOOL(0, "verify-signatures", &verify_signatures,
-		N_("Verify that the named commit has a valid GPG signature")),
+		N_("verify that the named commit has a valid GPG signature")),
 	OPT_CALLBACK('s', "strategy", &use_strategies, N_("strategy"),
 		N_("merge strategy to use"), option_parse_strategy),
 	OPT_CALLBACK('X', "strategy-option", &xopts, N_("option=value"),
@@ -223,7 +223,7 @@ static struct option builtin_merge_options[] = {
 		N_("abort the current in-progress merge")),
 	OPT_SET_INT(0, "progress", &show_progress, N_("force progress reporting"), 1),
 	{ OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"),
-	  N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
+		N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" },
 	OPT_BOOL(0, "overwrite-ignore", &overwrite_ignore, N_("update ignored files (default)")),
 	OPT_END()
 };
Signature · 1 line
2.4.0.7.gf20f26f
#6 lore raw

PATCH 2/6 merge: move error message given when a merge needs committing to advice.c

In reply to Stephen Robin

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

This will allow the message to be re-used in other places.

---
 advice.c        | 9 +++++++++
 advice.h        | 1 +
 builtin/merge.c | 6 +-----
 3 files changed, 11 insertions(+), 5 deletions(-)
advice.c +9 -0
index 575bec2..747792e 100644
@@ -96,6 +96,15 @@ void NORETURN die_resolve_conflict(const char *me)
 	die("Exiting because of an unresolved conflict.");
 }
 
+void NORETURN die_merge_in_progress()
+{
+	if (advice_resolve_conflict)
+		die(_("You have not concluded your merge (MERGE_HEAD exists).\n"
+		"Please, commit your changes before you merge."));
+	else
+		die(_("You have not concluded your merge (MERGE_HEAD exists)."));
+}
+
 void detach_advice(const char *new_name)
 {
 	const char fmt[] =
advice.h +1 -0
index 5ecc6c1..75c261a 100644
@@ -24,6 +24,7 @@ __attribute__((format (printf, 1, 2)))
 void advise(const char *advice, ...);
 int error_resolve_conflict(const char *me);
 extern void NORETURN die_resolve_conflict(const char *me);
+extern void NORETURN die_merge_in_progress();
 void detach_advice(const char *new_name);
 
 #endif /* ADVICE_H */
builtin/merge.c +1 -5
index d6b0579..45d93bb 100644
@@ -1134,11 +1134,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		 * There is no unmerged entry, don't advise 'git
 		 * add/rm <file>', just 'git commit'.
 		 */
-		if (advice_resolve_conflict)
-			die(_("You have not concluded your merge (MERGE_HEAD exists).\n"
-				  "Please, commit your changes before you merge."));
-		else
-			die(_("You have not concluded your merge (MERGE_HEAD exists)."));
+		die_merge_in_progress();
 	}
 	if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
 		if (advice_resolve_conflict)
Signature · 1 line
2.4.0.7.gf20f26f
#7 lore raw

PATCH 3/6 merge-base: split handle_fork_point to make reuse easier

In reply to Stephen Robin

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

Separate function handle_fork_point into one part that deals with command line arguments, printing error messages and exiting the process, and a second part that contains only the algorithm. The later part can be re-used elsewhere.

---
 builtin.h            |  2 ++
 builtin/merge-base.c | 64 ++++++++++++++++++++++++++++++++--------------------
 2 files changed, 41 insertions(+), 25 deletions(-)
builtin.h +2 -0
index b87df70..d8e0e5a 100644
@@ -27,6 +27,8 @@ extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
 
 extern int textconv_object(const char *path, unsigned mode, const unsigned char *sha1, int sha1_valid, char **buf, unsigned long *buf_size);
 
+extern const unsigned char *get_fork_point(const char *refname, const unsigned char *derived_sha1);
+
 extern int is_builtin(const char *s);
 
 extern int cmd_add(int argc, const char **argv, const char *prefix);
builtin/merge-base.c +39 -25

94 lines not on this page · raw message

Signature · 1 line
2.4.0.7.gf20f26f
#8 lore raw

PATCH 4/6 pull: reimplement as a builtin in C

In reply to Stephen Robin

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

Known differences between builtin/pull.c and git-pull.sh:
- The output of git pull -h and git pull --help-all has changed. It is now more comprehensive and consistent with other builtins.
- The error message given when dying due to unmerged changes in the working tree has changed. In git-pull.sh it would list all unmerged files. In builtin/pull.c it is consistent with git merge and will not list file status.
- --s and --st can no longer be used as a shorthand for --strategy. They would be ambiguous with --stat.

---
 .gitignore                   |   1 -
 Makefile                     |   2 +-
 builtin.h                    |   1 +
 builtin/pull.c               | 993 +++++++++++++++++++++++++++++++++++++++++++
 contrib/examples/git-pull.sh | 340 +++++++++++++++
 git-pull.sh                  | 340 ---------------
 git.c                        |   1 +
 7 files changed, 1336 insertions(+), 342 deletions(-)
 create mode 100644 builtin/pull.c
 create mode 100755 contrib/examples/git-pull.sh
 delete mode 100755 git-pull.sh
.gitignore +0 -1
index a052419..6287647 100644
@@ -108,7 +108,6 @@
 /git-patch-id
 /git-prune
 /git-prune-packed
-/git-pull
 /git-push
 /git-quiltimport
 /git-read-tree
Makefile +1 -1
index 5f3987f..8d8fb3a 100644
@@ -472,7 +472,6 @@ SCRIPT_SH += git-merge-octopus.sh
 SCRIPT_SH += git-merge-one-file.sh
 SCRIPT_SH += git-merge-resolve.sh
 SCRIPT_SH += git-mergetool.sh
-SCRIPT_SH += git-pull.sh
 SCRIPT_SH += git-quiltimport.sh
 SCRIPT_SH += git-rebase.sh
 SCRIPT_SH += git-remote-testgit.sh
@@ -874,6 +873,7 @@ BUILTIN_OBJS += builtin/pack-refs.o
 BUILTIN_OBJS += builtin/patch-id.o
 BUILTIN_OBJS += builtin/prune-packed.o
 BUILTIN_OBJS += builtin/prune.o
+BUILTIN_OBJS += builtin/pull.o
 BUILTIN_OBJS += builtin/push.o
 BUILTIN_OBJS += builtin/read-tree.o
 BUILTIN_OBJS += builtin/receive-pack.o
builtin.h +1 -0
index d8e0e5a..b2d7daa 100644
@@ -100,6 +100,7 @@ extern int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
 extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
 extern int cmd_prune(int argc, const char **argv, const char *prefix);
 extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
+extern int cmd_pull(int argc, const char **argv, const char *prefix);
 extern int cmd_push(int argc, const char **argv, const char *prefix);
 extern int cmd_read_tree(int argc, const char **argv, const char *prefix);
 extern int cmd_receive_pack(int argc, const char **argv, const char *prefix);
builtin/pull.c new file +993 -0

993 lines not on this page · raw message

contrib/examples/git-pull.sh new file +340 -0

340 lines not on this page · raw message

git-pull.sh deleted +0 -340

340 lines not on this page · raw message

git.c +1 -0
index 42a4ee5..cd824b6 100644
@@ -445,6 +445,7 @@ static struct cmd_struct commands[] = {
 	{ "pickaxe", cmd_blame, RUN_SETUP },
 	{ "prune", cmd_prune, RUN_SETUP },
 	{ "prune-packed", cmd_prune_packed, RUN_SETUP },
+	{ "pull", cmd_pull, RUN_SETUP | NEED_WORK_TREE },
 	{ "push", cmd_push, RUN_SETUP },
 	{ "read-tree", cmd_read_tree, RUN_SETUP },
 	{ "receive-pack", cmd_receive_pack },
Signature · 1 line
2.4.0.7.gf20f26f
#9 lore raw

PATCH 5/6 pull: allow interactive rebase

In reply to Stephen Robin

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

Teach 'git pull' the option --rebase=interactive
Teach 'git remote' that the value for config variable branch.<name>.rebase can be 'interactive'

---

Notes:
This feature is already present in msysgit. This patch can be used either to bring the feature into standard git, or to resolve the conflict that will occur in the next rebase of msysgit.

 Documentation/config.txt   |  1 +
 Documentation/git-pull.txt |  4 +++-
 builtin/pull.c             | 19 ++++++++++++++++---
 builtin/remote.c           |  8 ++++++--
 4 files changed, 26 insertions(+), 6 deletions(-)
Documentation/config.txt +1 -0
index 2e5ceaf..91314ef 100644
@@ -849,6 +849,7 @@ branch.<name>.rebase::
 	instead of merging the default branch from the default remote when
 	"git pull" is run. See "pull.rebase" for doing this in a non
 	branch-specific manner.
+	When the value is `interactive`, the rebase is run in interactive mode.
 +
 	When preserve, also pass `--preserve-merges` along to 'git rebase'
 	so that locally committed merge commits will not be flattened
Documentation/git-pull.txt +3 -1
index 712ab4b..8014908 100644
@@ -104,7 +104,7 @@ Options related to merging
 include::merge-options.txt[]
 
 -r::
---rebase[=false|true|preserve]::
+--rebase[=false|true|preserve|interactive]::
 	When true, rebase the current branch on top of the upstream
 	branch after fetching. If there is a remote-tracking branch
 	corresponding to the upstream branch and the upstream branch
@@ -116,6 +116,8 @@ to `git rebase` so that locally created merge commits will not be flattened.
 +
 When false, merge the current branch into the upstream branch.
 +
+When `interactive`, enable the interactive mode of rebase.
++
 See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
 linkgit:git-config[1] if you want to make `git pull` always use
 `--rebase` instead of merging.
builtin/pull.c +16 -3
index f420b4a..76c2f72 100644
@@ -26,7 +26,8 @@ enum pull_mode {
 	PULL_NOT_SET = -1,
 	PULL_MERGE,
 	PULL_REBASE,
-	PULL_PRESERVE_MERGES_REBASE
+	PULL_PRESERVE_MERGES_REBASE,
+	PULL_INTERACTIVE_REBASE
 };
 
 static const char * const builtin_pull_usage[] = {
@@ -85,12 +86,22 @@ static int parse_pull_mode(const char *name, const char* arg,
 		return 0;
 	}
 
+	if (!strcmp(arg, "interactive")) {
+		*option_rebase = PULL_INTERACTIVE_REBASE;
+		return 0;
+	}
+
+	if (!strcmp(arg, "i")) {
+		*option_rebase = PULL_INTERACTIVE_REBASE;
+		return 0;
+	}
+
 	if (!strcmp(arg, "preserve")) {
 		*option_rebase = PULL_PRESERVE_MERGES_REBASE;
 		return 0;
 	}
 
-	error(_("Invalid value for %s, should be 'true', 'false' or 'preserve'."), name);
+	error(_("Invalid value for %s, should be 'true', 'false', 'interactive' or 'preserve'."), name);
 	return -1;
 }
 
@@ -197,7 +208,7 @@ static int option_parse_x(const struct option *opt,
 }
 
 static struct option builtin_pull_options[] = {
-	{ OPTION_CALLBACK, 0, "rebase", NULL, N_("true|false|preserve"),
+	{ OPTION_CALLBACK, 0, "rebase", NULL, N_("true|false|interactive|preserve"),
 		N_("incorporate changes by rebasing rather than merging"),
 		PARSE_OPT_OPTARG, option_parse_rebase },
 	OPT_BOOL(0, "progress", &progress,
@@ -527,6 +538,8 @@ static int run_rebase(const struct string_list merge_head, const char *fork_poin
 
 	if (pull_mode == PULL_PRESERVE_MERGES_REBASE)
 		argv_array_push(&argv, "--preserve-merges");
+	else if (pull_mode == PULL_INTERACTIVE_REBASE)
+		argv_array_push(&argv, "-i");
 
 	for (v = verbosity; v > 0; v--)
 		argv_array_push(&argv, "-v");
builtin/remote.c +6 -2
index 5d3ab90..af6b21d 100644
@@ -245,7 +245,7 @@ static int add(int argc, const char **argv)
 struct branch_info {
 	char *remote_name;
 	struct string_list merge;
-	int rebase;
+	enum { NO_REBASE, NORMAL_REBASE, INTERACTIVE_REBASE } rebase;
 };
 
 static struct string_list branch_list;
@@ -306,6 +306,8 @@ static int config_read_branches(const char *key, const char *value, void *cb)
 				info->rebase = v;
 			else if (!strcmp(value, "preserve"))
 				info->rebase = 1;
+			else if (!strcmp(value, "interactive"))
+				info->rebase = INTERACTIVE_REBASE;
 		}
 	}
 	return 0;
@@ -1000,7 +1002,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data)
 
 	printf("    %-*s ", show_info->width, item->string);
 	if (branch_info->rebase) {
-		printf_ln(_("rebases onto remote %s"), merge->items[0].string);
+		printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ?
+			"rebases interactively onto remote %s" :
+			"rebases onto remote %s"), merge->items[0].string);
 		return 0;
 	} else if (show_info->any_rebase) {
 		printf_ln(_(" merges with remote %s"), merge->items[0].string);
Signature · 1 line
2.4.0.7.gf20f26f
#10 lore raw

Re: [PATCH 5/6] pull: allow interactive rebase

Hi Stephen,

Quoted 2 lines · Stephen Robin

Notes:
This feature is already present in msysgit.

Please note that it is "Git for Windows". The term "msysgit" just refers to the development environment required to compile Git for Windows 1.x and build its installer.

And yeah, I should contribute my changes already. Having said that, the --rebase=interactive support should not be a part of the initial conversion to a builtin because git-pull.sh as of git.git does not support it.

BTW Thanks for contributing the patch series, even if it is incomplete as you noted. I am sure that Paul (and for that matter, Stefan and I) will find it useful to see how you implemented the builtin git pull.

Ciao,
Johannes

#11 lore raw

PATCH 6/6 parse-remote: dismantle git-parse-remote.sh

In reply to Stephen Robin

THIS PATCH SERIES IS NOT CODE-COMPLETE OR FULLY TESTED. See code comments beginning TODO for work remaining.

Following the conversion of git-pull.sh to a builtin, git-parse-remote.sh is only used from two places:
function error_on_missing_default_upstream is used within git-rebase.sh only.
function get_default_remote is used within git-submodule.sh only.

Move these two functions into the scripts within which they're used, and delete git-parse-remote.sh itself.

---
 .gitignore                           |  1 -
 Documentation/git-parse-remote.txt   | 23 ----------
 Makefile                             |  1 -
 command-list.txt                     |  1 -
 contrib/examples/git-parse-remote.sh | 89 ++++++++++++++++++++++++++++++++++++
 git-parse-remote.sh                  | 89 ------------------------------------
 git-rebase.sh                        | 36 ++++++++++++++-
 git-submodule.sh                     |  8 +++-
 8 files changed, 131 insertions(+), 117 deletions(-)
 delete mode 100644 Documentation/git-parse-remote.txt
 create mode 100644 contrib/examples/git-parse-remote.sh
 delete mode 100644 git-parse-remote.sh
.gitignore +0 -1
index 6287647..dd25b33 100644
@@ -104,7 +104,6 @@
 /git-pack-redundant
 /git-pack-objects
 /git-pack-refs
-/git-parse-remote
 /git-patch-id
 /git-prune
 /git-prune-packed
Documentation/git-parse-remote.txt deleted +0 -23
deleted file mode 100644
index a45ea1e..0000000
@@ -1,23 +0,0 @@
-git-parse-remote(1)
-===================
-
-NAME
-----
-git-parse-remote - Routines to help parsing remote repository access parameters
-
-
-SYNOPSIS
---------
-[verse]
-'. "$(git --exec-path)/git-parse-remote"'
-
-DESCRIPTION
------------
-This script is included in various scripts to supply
-routines to parse files under $GIT_DIR/remotes/ and
-$GIT_DIR/branches/ and configuration variables that are related
-to fetching, pulling and pushing.
-
-GIT
----
-Part of the linkgit:git[1] suite
Makefile +0 -1
index 8d8fb3a..d41224c 100644
@@ -481,7 +481,6 @@ SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
 
 SCRIPT_LIB += git-mergetool--lib
-SCRIPT_LIB += git-parse-remote
 SCRIPT_LIB += git-rebase--am
 SCRIPT_LIB += git-rebase--interactive
 SCRIPT_LIB += git-rebase--merge
command-list.txt +0 -1
index f1eae08..273f69e 100644
@@ -86,7 +86,6 @@ git-p4                                  foreignscminterface
 git-pack-objects                        plumbingmanipulators
 git-pack-redundant                      plumbinginterrogators
 git-pack-refs                           ancillarymanipulators
-git-parse-remote                        synchelpers
 git-patch-id                            purehelpers
 git-prune                               ancillarymanipulators
 git-prune-packed                        plumbingmanipulators
contrib/examples/git-parse-remote.sh new file +89 -0

89 lines not on this page · raw message

git-parse-remote.sh deleted +0 -89

89 lines not on this page · raw message

git-rebase.sh +35 -1
index 55da9db..7b157ec 100755
@@ -209,6 +209,41 @@ run_pre_rebase_hook () {
 	fi
 }
 
+error_on_missing_default_upstream () {
+	cmd="$1"
+	op_type="$2"
+	op_prep="$3"
+	example="$4"
+	branch_name=$(git symbolic-ref -q HEAD)
+	# If there's only one remote, use that in the suggestion
+	remote="<remote>"
+	if test $(git remote | wc -l) = 1
+	then
+		remote=$(git remote)
+	fi
+
+	if test -z "$branch_name"
+	then
+		echo "You are not currently on a branch. Please specify which
+branch you want to $op_type $op_prep. See git-${cmd}(1) for details.
+
+    $example
+"
+	else
+		echo "There is no tracking information for the current branch.
+Please specify which branch you want to $op_type $op_prep.
+See git-${cmd}(1) for details
+
+    $example
+
+If you wish to set tracking information for this branch you can do so with:
+
+    git branch --set-upstream-to=$remote/<branch> ${branch_name#refs/heads/}
+"
+	fi
+	exit 1
+}
+
 test -f "$apply_dir"/applying &&
 	die "$(gettext "It looks like git-am is in progress. Cannot rebase.")"
 
@@ -446,7 +481,6 @@ then
 		if ! upstream_name=$(git rev-parse --symbolic-full-name \
 			--verify -q @{upstream} 2>/dev/null)
 		then
-			. git-parse-remote
 			error_on_missing_default_upstream "rebase" "rebase" \
 				"against" "git rebase <branch>"
 		fi
git-submodule.sh +7 -1
index 36797c3..08c31eb 100755
@@ -17,7 +17,6 @@ OPTIONS_SPEC=
 SUBDIRECTORY_OK=Yes
 . git-sh-setup
 . git-sh-i18n
-. git-parse-remote
 require_work_tree
 wt_prefix=$(git rev-parse --show-prefix)
 cd_to_toplevel
@@ -37,6 +36,13 @@ prefix=
 custom_name=
 depth=
 
+get_default_remote () {
+	curr_branch=$(git symbolic-ref -q HEAD)
+	curr_branch="${curr_branch#refs/heads/}"
+	origin=$(git config --get "branch.$curr_branch.remote")
+	echo ${origin:-origin}
+}
+
 # The function takes at most 2 arguments. The first argument is the
 # URL that navigates to the submodule origin repo. When relative, this URL
 # is relative to the superproject origin URL repo. The second up_path
Signature · 1 line
2.4.0.7.gf20f26f
#12 lore raw

Re: [PATCH 0/6] Make pull a builtin

In reply to Stephen Robin

Hi Stephen,

Quoted 12 lines · Stephen Robin

Hi Paul,

Congratulations on getting your project accepted for GSOC. Here's my attempt at implementing pull as a builtin, maybe it will be of some use as you look to progress your version.

It's fairly complete in the sense that all the features of git-pull.sh should be implemented, the test suite passes, and I've been using it myself without issue. At the same time it's some way from finished as I've never had time to test it fully and there are parts of the code I'm not happy with.

Quoted 7 lines

Apologies for not sharing this with you earlier. I have been too busy with paid work to look at any open source projects for some months.

Good luck with your project!

Regards
Stephen

Thank you so much for sharing your work. I'll be referencing this.

Regards,
Paul