From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [PATCH 2/2] Loosen "working file will be lost" check in Porcelain-ish
Date: Mon, 04 Dec 2006 17:11:02 -0800 [thread overview]
Message-ID: <7vbqmjkuzd.fsf@assigned-by-dhcp.cox.net> (raw)
This uses the previous update to read-tree in Porcelain-ish
commands "git checkout" and "git merge" to loosen the check
when switching branches.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
git-checkout.sh | 5 +++--
git-merge.sh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/git-checkout.sh b/git-checkout.sh
index 737abd0..a2be213 100755
--- a/git-checkout.sh
+++ b/git-checkout.sh
@@ -161,7 +161,7 @@ then
git-read-tree --reset -u $new
else
git-update-index --refresh >/dev/null
- merge_error=$(git-read-tree -m -u $old $new 2>&1) || (
+ merge_error=$(git-read-tree -m -u --ignore=.gitignore $old $new 2>&1) || (
case "$merge" in
'')
echo >&2 "$merge_error"
@@ -172,7 +172,8 @@ else
git diff-files --name-only | git update-index --remove --stdin &&
work=`git write-tree` &&
git read-tree --reset -u $new &&
- git read-tree -m -u --aggressive $old $new $work || exit
+ git read-tree -m -u --aggressive --ignore=.gitignore $old $new $work ||
+ exit
if result=`git write-tree 2>/dev/null`
then
diff --git a/git-merge.sh b/git-merge.sh
index 272f004..830f471 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -264,7 +264,7 @@ f,*)
echo "Updating $(git-rev-parse --short $head)..$(git-rev-parse --short $1)"
git-update-index --refresh 2>/dev/null
new_head=$(git-rev-parse --verify "$1^0") &&
- git-read-tree -u -v -m $head "$new_head" &&
+ git-read-tree -v -m -u --ignore=.gitignore $head "$new_head" &&
finish "$new_head" "Fast forward"
dropsave
exit 0
--
1.4.4.1.ga37e
reply other threads:[~2006-12-05 1:11 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=7vbqmjkuzd.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox