Re: Git User's Survey 2007 unfinished summary continued

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



J. Bruce Fields wrote:
I'm lost--how is "hg pull" different from "git pull" in this respect?

(Pedantry alert: "hg pull" is equivalent to "git fetch" and doesn't update the working copy. I'll talk here about the "hg pull; hg update" pair which seems to be standard procedure in hg land.)

Here's a simple example in each system to demonstrate the difference.

---
mkdir parent
cd parent
git init
echo 'my baloney has a first name' > song.txt
echo "it's o-s-c-a-r" >> song.txt
echo 'my baloney has a last name' >> song.txt
git add song.txt
git commit -m "test file"
cd ..
git clone parent child
cd parent
echo "it's m-a-y-e-r" >> song.txt
git commit -a -m "another line in the song"
cd ../child
perl -pi -e 's/first name/given name/' song.txt
git pull
---

Result: "fatal: Entry 'song.txt not uptodate. Cannot merge."

---
mkdir hgparent
cd hgparent
hg init
echo 'my baloney has a first name' > song.txt
echo "it's o-s-c-a-r" >> song.txt
echo 'my baloney has a last name' >> song.txt
hg add song.txt
hg commit -m "test file"
cd ..
hg clone hgparent hgchild
cd hgparent
echo "it's m-a-y-e-r" >> song.txt
hg commit -m "another line in the song"
cd ../hgchild
perl -pi -e 's/first name/given name/' song.txt
hg pull
hg update
---

Result: "0 files updated, 1 files merged, 0 files removed, 0 files unresolved" and the file contains the change from the parent plus the change from the child, with the latter still an uncommitted edit that shows up in "hg diff".

-Steve
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux