git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH 2/4] Use BASE index extension in git-am.
Date: Sun, 08 Apr 2007 23:13:33 -0700	[thread overview]
Message-ID: <7vwt0m3wj6.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 7vps6e5b93.fsf_-_@assigned-by-dhcp.cox.net

This makes git-am to record the expected HEAD location after
finishing its operation in the index, so that subsequent BASE
check would notice when somebody else updated your branch head
while you are looking the other way.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-am.sh |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index e69ecbf..27912ce 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -13,6 +13,7 @@ git var GIT_COMMITTER_IDENT >/dev/null || exit
 
 stop_here () {
     echo "$1" >"$dotest/next"
+    git update-index --set-base $(git rev-parse --verify HEAD)
     exit 1
 }
 
@@ -157,6 +158,8 @@ do
 	esac
 done
 
+check_base || exit
+
 # If the dotest directory exists, but we have finished applying all the
 # patches in them, clear it out.
 if test -d "$dotest" &&
@@ -468,5 +471,6 @@ do
 
 	go_next
 done
+git update-index --set-base $(git rev-parse --verify HEAD)
 
 rm -fr "$dotest"
-- 
1.5.1.730.g0d43be

  parent reply	other threads:[~2007-04-09  6:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03  5:41 What's cooking in git.git (topics) Junio C Hamano
2007-04-05  7:03 ` Junio C Hamano
2007-04-09  6:10   ` The index is based on blah, however, the HEAD points at different commit Junio C Hamano
2007-04-09  6:13     ` [PATCH 1/4] Move check_base() shell function to git-sh-setup Junio C Hamano
2007-04-09  6:13     ` Junio C Hamano [this message]
2007-04-09  6:13     ` [PATCH 3/4] git-read-tree --set-base=<commit> Junio C Hamano
2007-04-09  6:13     ` [PATCH 4/4] Teach git-reset to use index BASE extension Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=7vwt0m3wj6.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).