{"thread":{"id":"18790","subject":"need help with git show :1:...","startedAt":"2009-04-08T17:41:26Z","lastAt":"2009-04-08T18:38:06Z","messageCount":8,"participants":["layer","Elijah Newren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"110847","messageId":"6838.1239212486@relay.known.net","threadId":"18790","inReplyTo":null,"subject":"need help with git show :1:...","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2009-04-08T17:41:26Z","receivedAt":"2009-04-08T17:41:26Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"I remember this working for me in the not too distant past.  \nI'm using git version 1.6.1.3.  Perhaps it was an older version of git\nwhen it worked for me.\n\nquadra% ls -l src/c/sock.c\n-rw-r--r-- 1 layer fi 57909 Mar  9 13:32 src/c/sock.c\nquadra% git show :2:src/c/sock.c\nfatal: ambiguous argument ':2:src/c/sock.c': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\nquadra% git show :1:c/sock.c\nfatal: ambiguous argument ':1:c/sock.c': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\nquadra% git show :1:sock.c\nfatal: ambiguous argument ':1:sock.c': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\nquadra% git show :1:/src/c/sock.c\nfatal: ambiguous argument ':1:/src/c/sock.c': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\n\n\n\n\nIf I cd to \"src/c\" and do \"git show :1:sock.c\" the same thing happens.\n\nThanks.\n"},{"id":"110849","messageId":"51419b2c0904081058p7d5a56c3j6aa5cebb0188ad43@mail.gmail.com","threadId":"18790","inReplyTo":"6838.1239212486@relay.known.net","subject":"Re: need help with git show :1:...","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2009-04-08T17:58:45Z","receivedAt":"2009-04-08T17:58:45Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Wed, Apr 8, 2009 at 11:41 AM, layer <layer@known.net> wrote:\n> I remember this working for me in the not too distant past.\n> I'm using git version 1.6.1.3.  Perhaps it was an older version of git\n> when it worked for me.\n>\n> quadra% ls -l src/c/sock.c\n> -rw-r--r-- 1 layer fi 57909 Mar  9 13:32 src/c/sock.c\n> quadra% git show :2:src/c/sock.c\n> fatal: ambiguous argument ':2:src/c/sock.c': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> quadra% git show :1:c/sock.c\n> fatal: ambiguous argument ':1:c/sock.c': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> quadra% git show :1:sock.c\n> fatal: ambiguous argument ':1:sock.c': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> quadra% git show :1:/src/c/sock.c\n> fatal: ambiguous argument ':1:/src/c/sock.c': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n\nDoes the file have conflicts?  Try\n  $ git ls-files -s src/c/sock.c\nand report what the output is.\n\nIf it doesn't have conflicts, but the file is tracked by git, using\nstage 0 should work:\n  $ git show :0:src/c/sock.c\n"},{"id":"110850","messageId":"7199.1239213762@relay.known.net","threadId":"18790","inReplyTo":"51419b2c0904081058p7d5a56c3j6aa5cebb0188ad43@mail.gmail.com","subject":"Re: need help with git show :1:...","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2009-04-08T18:02:42Z","receivedAt":"2009-04-08T18:02:42Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"Elijah Newren <newren@gmail.com> wrote:\n\n>> Does the file have conflicts?  Try\n>> git ls-files -s src/c/sock.c\n\nYes, it did have conflicts.  I resolved the conflicts via editing, but\nwant to look at the other versions before finalizing the edits.\n\nquadra% git ls-files -s src/c/sock.c\n100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0\tsrc/c/sock.c\nquadra% \n\nElijah, thanks for replying.\n"},{"id":"110851","messageId":"51419b2c0904081107s7ba08367w671d5b494095402@mail.gmail.com","threadId":"18790","inReplyTo":"7199.1239213762@relay.known.net","subject":"Re: need help with git show :1:...","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2009-04-08T18:07:00Z","receivedAt":"2009-04-08T18:07:00Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:\n> Elijah Newren <newren@gmail.com> wrote:\n>>> Does the file have conflicts?  Try\n>>> git ls-files -s src/c/sock.c\n>\n> Yes, it did have conflicts.  I resolved the conflicts via editing, but\n> want to look at the other versions before finalizing the edits.\n>\n> quadra% git ls-files -s src/c/sock.c\n> 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0       src/c/sock.c\n\nThat suggests that the file is not unmerged, i.e. that there aren't\nany remaining conflicts.  This explains why your commands wouldn't\nwork unless you used stage 0 instead of 1 or 2.  Now, why there\nweren't conflicts when you thought there were?  I have no idea, unless\nperhaps you did a stray git add src/c/sock.c.\n\nHope that helps,\nElijah\n"},{"id":"110852","messageId":"7357.1239214209@relay.known.net","threadId":"18790","inReplyTo":"51419b2c0904081107s7ba08367w671d5b494095402@mail.gmail.com","subject":"Re: need help with git show :1:...","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2009-04-08T18:10:09Z","receivedAt":"2009-04-08T18:10:09Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"Elijah Newren <newren@gmail.com> wrote:\n\n>> Hi,\n>> \n>> On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:\n>> > Elijah Newren <newren@gmail.com> wrote:\n>> >>> Does the file have conflicts?  Try\n>> >>> git ls-files -s src/c/sock.c\n>> >\n>> > Yes, it did have conflicts.  I resolved the conflicts via editing, but\n>> > want to look at the other versions before finalizing the edits.\n>> >\n>> > quadra% git ls-files -s src/c/sock.c\n>> > 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0       src/c/sock.c\n>> \n>> That suggests that the file is not unmerged, i.e. that there aren't\n>> any remaining conflicts.  This explains why your commands wouldn't\n>> work unless you used stage 0 instead of 1 or 2.  Now, why there\n>> weren't conflicts when you thought there were?  I have no idea, unless\n>> perhaps you did a stray git add src/c/sock.c.\n\nIt was several of weeks ago that I started this merge, and I remember\nplaying with git show then and it worki.  I might have overwriten\nthe file with one of the show's and done manual editing that way.  I\ndon't know if this makes a difference.\n\nHow can I redo the merge for just this file?  Is that possible?  I\nthink I'd definitely like to start over on *just this one file*.\n\nThanks.\n"},{"id":"110854","messageId":"51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com","threadId":"18790","inReplyTo":"7357.1239214209@relay.known.net","subject":"Re: need help with git show :1:...","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2009-04-08T18:25:35Z","receivedAt":"2009-04-08T18:25:35Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Wed, Apr 8, 2009 at 12:10 PM, layer <layer@known.net> wrote:\n> Elijah Newren <newren@gmail.com> wrote:\n>>> On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:\n>>> > quadra% git ls-files -s src/c/sock.c\n>>> > 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0       src/c/sock.c\n>>>\n>>> That suggests that the file is not unmerged, i.e. that there aren't\n>>> any remaining conflicts.  This explains why your commands wouldn't\n>>> work unless you used stage 0 instead of 1 or 2.  Now, why there\n>>> weren't conflicts when you thought there were?  I have no idea, unless\n>>> perhaps you did a stray git add src/c/sock.c.\n>\n> It was several of weeks ago that I started this merge, and I remember\n> playing with git show then and it worki.  I might have overwriten\n> the file with one of the show's and done manual editing that way.  I\n> don't know if this makes a difference.\n>\n> How can I redo the merge for just this file?  Is that possible?  I\n> think I'd definitely like to start over on *just this one file*.\n\nWell, someone else probably knows a clever way to do this.  I don't,\nbut the following may help:\n\nMERGE_REF=$(cat .git/MERGE_HEAD)\ngit show HEAD:src/c/sock.c > current-sock\ngit show $MERGE_REF:src/c/sock.c > other-sock\ngit show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock\ngit merge-file current-sock other-sock base-sock\n\nThat'll redo the three way merge on src/c/sock.c (assuming no renames\nor other special cases happened) and store the result in current-sock.\n You can then edit that file and when ready, move the result over\nsrc/c/sock.c.\n\nElijah\n"},{"id":"110855","messageId":"7685.1239215733@relay.known.net","threadId":"18790","inReplyTo":"51419b2c0904081125u3bdf37deyd5dd85f6c2a6d7cc@mail.gmail.com","subject":"Re: need help with git show :1:...","fromName":"layer","fromEmail":"layer@known.net","sentAt":"2009-04-08T18:35:33Z","receivedAt":"2009-04-08T18:35:33Z","isPatch":false,"sender":{"key":"layer@known.net","avatar":null},"body":"Elijah Newren <newren@gmail.com> wrote:\n\n>> > How can I redo the merge for just this file?  Is that possible?  I\n>> > think I'd definitely like to start over on *just this one file*.\n>> \n>> Well, someone else probably knows a clever way to do this.  I don't,\n>> but the following may help:\n>> \n>> MERGE_REF=$(cat .git/MERGE_HEAD)\n>> git show HEAD:src/c/sock.c > current-sock\n>> git show $MERGE_REF:src/c/sock.c > other-sock\n>> git show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock\n>> git merge-file current-sock other-sock base-sock\n\nDid you mean this?\n\n  git merge-file current-sock base-sock other-sock\n\nThe man page seems to indicate that.\n\n>> That'll redo the three way merge on src/c/sock.c (assuming no renames\n>> or other special cases happened) and store the result in current-sock.\n>>  You can then edit that file and when ready, move the result over\n>> src/c/sock.c.\n\nThanks.  This is a big help.\n"},{"id":"110857","messageId":"51419b2c0904081138o3f05a6fm6a4213e7b0f1db6f@mail.gmail.com","threadId":"18790","inReplyTo":"7685.1239215733@relay.known.net","subject":"Re: need help with git show :1:...","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2009-04-08T18:38:06Z","receivedAt":"2009-04-08T18:38:06Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\nOn Wed, Apr 8, 2009 at 12:35 PM, layer <layer@known.net> wrote:\n<snip>\n>>> git merge-file current-sock other-sock base-sock\n>\n> Did you mean this?\n>\n>  git merge-file current-sock base-sock other-sock\n>\n> The man page seems to indicate that.\n\nOops, yeah, current then base then other, like the manpage says.\n"}]}