Re: [PATCH] status&commit: Teach them to show commits of modified submodules.

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

 



On 11/3/07, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> "Yin Ping" <pkufranky@xxxxxxxxx> writes:
>
> > On 11/3/07, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> >> How does this work when you are a toplevel developer and do not
> >> have the submodule cloned and checked out?
> >>
> >> Our code should treat having the submodule directory and not
> >> having it when there is a mode 160000 entry in the index equally
> >> likely.  Cloning and checking-out is _not_ the norm (nor the
> >> exception).
> >>
> > When submodule is not cheched out, it is never modified.
>
> How so?  Can't you update the index alone?
>
Sorry i have been away and come back just now.

I think it's a rare case that the submodule entry in the index is
different from HEAD when the submodule is not checked out.

This may only happen when git-reset --soft is called. However, it may
be a wrong  operation to commit the changed submodule index entry
while the submodule is never checked out.

There is another similar case, 'git pull' update the submodule entry
in both HEAD and index, but the submodule checked out is not updated.
In this case, 'git-log since..until'  in the submodule directory will
fail since 'until' commit is not checked out yet. I think it may be
also a user mistake.

In both case, i think the user should be notified about the
inconsistence. My patch handle this by two warning messages as follows
(where $name is module name)

+                       cd $name >&/dev/null || { echo "  Warning:
fail to chdir to $name" && exit; }


+                       if echo "$left$right" | grep 'unknown
revision' >&/dev/null
+                       then
+                               echo "  Warning: $name is not a
repository or dosn't contains commit $headone/$indexone"
+                       else



-- 
franky
-
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