git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Santi Béjar" <sbejar@gmail.com>
To: git <git@vger.kernel.org>
Subject: [PATCH] git-fetch: Understand the branch property remote="."
Date: Sun, 15 Oct 2006 23:16:49 +0200	[thread overview]
Message-ID: <87bqod9t4u.fsf@gmail.com> (raw)


It extends the branch property "remote" to understand that "." is the local
repository.

With this, for example, in git.git you could have:

[branch "next"]
  remote="."
  merge=master

so the default merge in the next branch is the master branch in the
local repository.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 git-parse-remote.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 679f73c..617d022 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -187,6 +187,15 @@ get_remote_refs_for_push () {
 }
 
 get_remote_refs_for_fetch () {
+	if [ "$#,$1" = "1,." ] ;
+	then
+	    curr_branch=$(git-symbolic-ref HEAD | sed -e 's|^refs/heads/||')
+	    branch_remote=$(git-repo-config --get "branch.$curr_branch.remote")
+	    if [ "$branch_remote" = "." ]
+	    then
+		set . $(git-repo-config --get-all "branch.${curr_branch}.merge")
+	    fi
+	fi
 	case "$#" in
 	0)
 	    die "internal error: get-remote-refs-for-fetch." ;;
-- 
1.4.3.rc2.ga442

                 reply	other threads:[~2006-10-15 21:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bqod9t4u.fsf@gmail.com \
    --to=sbejar@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).