From: Cory Sharp <cory.sharp@gmail.com>
To: git@vger.kernel.org
Subject: Re: [Q] merge squash unexpected conflicts
Date: Wed, 13 May 2009 19:42:36 -0700 [thread overview]
Message-ID: <bb9d69200905131942t7a43a29fh9638d2548e9f12dc@mail.gmail.com> (raw)
In-Reply-To: <bb9d69200905131706m61b0dda1xc347ca2e719ec142@mail.gmail.com>
Using git 1.6.3.1, when using "git merge --squash" I get unexpected
conflicts when merging an update to a file that was added after the
original branch point, like this
* Initialize git repo
* Add hello to master
* Create topic branch
* Add goodbye to master
* Merge squash master into topic, gets new goodbye
* Update goodbye in master
* Again merge squash master into topic, update goodbye
The second merge squash produces a conflict in goodbye.
Am I doing something a little wrong or unexpected? Is there a way
around this squash conflict behavior? This doesn't seem to happen
with plain merge without squash. I've appended a small bash script to
show this behavior - run it from an empty directory.
Thanks,
Cory
#!/bin/sh
try() {
echo "$@"
"$@" || exit 1
}
note() {
echo
echo "##" "$@" "##"
}
[ -d .git ] && echo .git already exists, aborting. && exit 1
note "Initialize git repo"
try git init
note "Add hello to master"
echo "hello world" > hello.txt
try git add hello.txt
try git commit -m "Added hello"
note "Create topic branch"
try git checkout -b topic
note "Add goodbye to master"
try git checkout master
echo "farewell world" > goodbye.txt
try git add goodbye.txt
try git commit -m "Added goodbye"
note "Merge master into topic, gets new goodbye"
try git checkout topic
try git merge --squash master
try git commit -m "Merged master"
note "Update goodbye in master"
try git checkout master
echo "goodbye world" > goodbye.txt
try git add goodbye.txt
try git commit -m "Updated goodbye"
note "Again merge master into topic, update goodbye"
try git checkout topic
try git merge --squash master
next parent reply other threads:[~2009-05-14 2:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bb9d69200905131706m61b0dda1xc347ca2e719ec142@mail.gmail.com>
2009-05-14 2:42 ` Cory Sharp [this message]
2009-05-14 3:21 ` [Q] merge squash unexpected conflicts Junio C Hamano
2009-05-14 3:57 ` Cory Sharp
2009-05-14 4:42 ` Junio C Hamano
2009-05-14 6:34 ` Cory Sharp
2009-05-14 6:42 ` Junio C Hamano
2009-05-14 6:54 ` Cory Sharp
2009-05-14 7:01 ` Michael Radziej
2009-05-14 18:25 ` Cory Sharp
2009-05-14 12:17 ` Michael J Gruber
2009-05-14 14:47 ` Cory Sharp
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=bb9d69200905131942t7a43a29fh9638d2548e9f12dc@mail.gmail.com \
--to=cory.sharp@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).