* need help with git show :1:...
@ 2009-04-08 17:41 layer
2009-04-08 17:58 ` Elijah Newren
0 siblings, 1 reply; 9+ messages in thread
From: layer @ 2009-04-08 17:41 UTC (permalink / raw)
To: git
I remember this working for me in the not too distant past.
I'm using git version 1.6.1.3. Perhaps it was an older version of git
when it worked for me.
quadra% ls -l src/c/sock.c
-rw-r--r-- 1 layer fi 57909 Mar 9 13:32 src/c/sock.c
quadra% git show :2:src/c/sock.c
fatal: ambiguous argument ':2:src/c/sock.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
quadra% git show :1:c/sock.c
fatal: ambiguous argument ':1:c/sock.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
quadra% git show :1:sock.c
fatal: ambiguous argument ':1:sock.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
quadra% git show :1:/src/c/sock.c
fatal: ambiguous argument ':1:/src/c/sock.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
If I cd to "src/c" and do "git show :1:sock.c" the same thing happens.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
@ 2009-04-08 17:57 layer
0 siblings, 0 replies; 9+ messages in thread
From: layer @ 2009-04-08 17:57 UTC (permalink / raw)
To: git
I didn't make it clear, but I am in the process of resolve conflicts
from a merge in the repo where those commands were executed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 17:41 layer
@ 2009-04-08 17:58 ` Elijah Newren
2009-04-08 18:02 ` layer
0 siblings, 1 reply; 9+ messages in thread
From: Elijah Newren @ 2009-04-08 17:58 UTC (permalink / raw)
To: layer; +Cc: git
On Wed, Apr 8, 2009 at 11:41 AM, layer <layer@known.net> wrote:
> I remember this working for me in the not too distant past.
> I'm using git version 1.6.1.3. Perhaps it was an older version of git
> when it worked for me.
>
> quadra% ls -l src/c/sock.c
> -rw-r--r-- 1 layer fi 57909 Mar 9 13:32 src/c/sock.c
> quadra% git show :2:src/c/sock.c
> fatal: ambiguous argument ':2:src/c/sock.c': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
> quadra% git show :1:c/sock.c
> fatal: ambiguous argument ':1:c/sock.c': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
> quadra% git show :1:sock.c
> fatal: ambiguous argument ':1:sock.c': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
> quadra% git show :1:/src/c/sock.c
> fatal: ambiguous argument ':1:/src/c/sock.c': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
Does the file have conflicts? Try
$ git ls-files -s src/c/sock.c
and report what the output is.
If it doesn't have conflicts, but the file is tracked by git, using
stage 0 should work:
$ git show :0:src/c/sock.c
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 17:58 ` Elijah Newren
@ 2009-04-08 18:02 ` layer
2009-04-08 18:07 ` Elijah Newren
0 siblings, 1 reply; 9+ messages in thread
From: layer @ 2009-04-08 18:02 UTC (permalink / raw)
To: Elijah Newren; +Cc: git
Elijah Newren <newren@gmail.com> wrote:
>> Does the file have conflicts? Try
>> git ls-files -s src/c/sock.c
Yes, it did have conflicts. I resolved the conflicts via editing, but
want to look at the other versions before finalizing the edits.
quadra% git ls-files -s src/c/sock.c
100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0 src/c/sock.c
quadra%
Elijah, thanks for replying.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 18:02 ` layer
@ 2009-04-08 18:07 ` Elijah Newren
2009-04-08 18:10 ` layer
0 siblings, 1 reply; 9+ messages in thread
From: Elijah Newren @ 2009-04-08 18:07 UTC (permalink / raw)
To: layer; +Cc: git
Hi,
On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:
> Elijah Newren <newren@gmail.com> wrote:
>>> Does the file have conflicts? Try
>>> git ls-files -s src/c/sock.c
>
> Yes, it did have conflicts. I resolved the conflicts via editing, but
> want to look at the other versions before finalizing the edits.
>
> quadra% git ls-files -s src/c/sock.c
> 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0 src/c/sock.c
That suggests that the file is not unmerged, i.e. that there aren't
any remaining conflicts. This explains why your commands wouldn't
work unless you used stage 0 instead of 1 or 2. Now, why there
weren't conflicts when you thought there were? I have no idea, unless
perhaps you did a stray git add src/c/sock.c.
Hope that helps,
Elijah
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 18:07 ` Elijah Newren
@ 2009-04-08 18:10 ` layer
2009-04-08 18:25 ` Elijah Newren
0 siblings, 1 reply; 9+ messages in thread
From: layer @ 2009-04-08 18:10 UTC (permalink / raw)
To: Elijah Newren; +Cc: git
Elijah Newren <newren@gmail.com> wrote:
>> Hi,
>>
>> On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:
>> > Elijah Newren <newren@gmail.com> wrote:
>> >>> Does the file have conflicts? Try
>> >>> git ls-files -s src/c/sock.c
>> >
>> > Yes, it did have conflicts. I resolved the conflicts via editing, but
>> > want to look at the other versions before finalizing the edits.
>> >
>> > quadra% git ls-files -s src/c/sock.c
>> > 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0 src/c/sock.c
>>
>> That suggests that the file is not unmerged, i.e. that there aren't
>> any remaining conflicts. This explains why your commands wouldn't
>> work unless you used stage 0 instead of 1 or 2. Now, why there
>> weren't conflicts when you thought there were? I have no idea, unless
>> perhaps you did a stray git add src/c/sock.c.
It was several of weeks ago that I started this merge, and I remember
playing with git show then and it worki. I might have overwriten
the file with one of the show's and done manual editing that way. I
don't know if this makes a difference.
How can I redo the merge for just this file? Is that possible? I
think I'd definitely like to start over on *just this one file*.
Thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 18:10 ` layer
@ 2009-04-08 18:25 ` Elijah Newren
2009-04-08 18:35 ` layer
0 siblings, 1 reply; 9+ messages in thread
From: Elijah Newren @ 2009-04-08 18:25 UTC (permalink / raw)
To: layer; +Cc: git
Hi,
On Wed, Apr 8, 2009 at 12:10 PM, layer <layer@known.net> wrote:
> Elijah Newren <newren@gmail.com> wrote:
>>> On Wed, Apr 8, 2009 at 12:02 PM, layer <layer@known.net> wrote:
>>> > quadra% git ls-files -s src/c/sock.c
>>> > 100644 ef6c9b94c678dc79760edfd15a0796b3726b76f6 0 src/c/sock.c
>>>
>>> That suggests that the file is not unmerged, i.e. that there aren't
>>> any remaining conflicts. This explains why your commands wouldn't
>>> work unless you used stage 0 instead of 1 or 2. Now, why there
>>> weren't conflicts when you thought there were? I have no idea, unless
>>> perhaps you did a stray git add src/c/sock.c.
>
> It was several of weeks ago that I started this merge, and I remember
> playing with git show then and it worki. I might have overwriten
> the file with one of the show's and done manual editing that way. I
> don't know if this makes a difference.
>
> How can I redo the merge for just this file? Is that possible? I
> think I'd definitely like to start over on *just this one file*.
Well, someone else probably knows a clever way to do this. I don't,
but the following may help:
MERGE_REF=$(cat .git/MERGE_HEAD)
git show HEAD:src/c/sock.c > current-sock
git show $MERGE_REF:src/c/sock.c > other-sock
git show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock
git merge-file current-sock other-sock base-sock
That'll redo the three way merge on src/c/sock.c (assuming no renames
or other special cases happened) and store the result in current-sock.
You can then edit that file and when ready, move the result over
src/c/sock.c.
Elijah
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 18:25 ` Elijah Newren
@ 2009-04-08 18:35 ` layer
2009-04-08 18:38 ` Elijah Newren
0 siblings, 1 reply; 9+ messages in thread
From: layer @ 2009-04-08 18:35 UTC (permalink / raw)
To: Elijah Newren; +Cc: git
Elijah Newren <newren@gmail.com> wrote:
>> > How can I redo the merge for just this file? Is that possible? I
>> > think I'd definitely like to start over on *just this one file*.
>>
>> Well, someone else probably knows a clever way to do this. I don't,
>> but the following may help:
>>
>> MERGE_REF=$(cat .git/MERGE_HEAD)
>> git show HEAD:src/c/sock.c > current-sock
>> git show $MERGE_REF:src/c/sock.c > other-sock
>> git show $(git merge-base $MERGE_REF HEAD):src/c/sock.c > base-sock
>> git merge-file current-sock other-sock base-sock
Did you mean this?
git merge-file current-sock base-sock other-sock
The man page seems to indicate that.
>> That'll redo the three way merge on src/c/sock.c (assuming no renames
>> or other special cases happened) and store the result in current-sock.
>> You can then edit that file and when ready, move the result over
>> src/c/sock.c.
Thanks. This is a big help.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: need help with git show :1:...
2009-04-08 18:35 ` layer
@ 2009-04-08 18:38 ` Elijah Newren
0 siblings, 0 replies; 9+ messages in thread
From: Elijah Newren @ 2009-04-08 18:38 UTC (permalink / raw)
To: layer; +Cc: git
Hi,
On Wed, Apr 8, 2009 at 12:35 PM, layer <layer@known.net> wrote:
<snip>
>>> git merge-file current-sock other-sock base-sock
>
> Did you mean this?
>
> git merge-file current-sock base-sock other-sock
>
> The man page seems to indicate that.
Oops, yeah, current then base then other, like the manpage says.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-04-08 18:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 17:57 need help with git show :1: layer
-- strict thread matches above, loose matches on Subject: below --
2009-04-08 17:41 layer
2009-04-08 17:58 ` Elijah Newren
2009-04-08 18:02 ` layer
2009-04-08 18:07 ` Elijah Newren
2009-04-08 18:10 ` layer
2009-04-08 18:25 ` Elijah Newren
2009-04-08 18:35 ` layer
2009-04-08 18:38 ` Elijah Newren
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).