git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lars Hjemli <hjemli@gmail.com>, Ping Yin <pkufranky@gmail.com>,
	Mark Levedahl <mlevedahl@gmail.com>
Cc: git@vger.kernel.org, Sylvain Joyeux <sylvain.joyeux@dfki.de>
Subject: Re: [PATCH] better git-submodule status output
Date: Sat, 05 Jul 2008 23:19:16 -0700	[thread overview]
Message-ID: <7vhcb3o7q3.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080701150119.GE5852@joyeux> (Sylvain Joyeux's message of "Tue, 1 Jul 2008 17:01:19 +0200")

Sylvain Joyeux <sylvain.joyeux@dfki.de> writes:

> This patch makes the output of git-submodule more useful to handle the
> management of a repository using multiple submodules. Namely, it
> displays informations about how the current checked out version relates
> to the registered one (i.e. direct parent, direct child, "just
> different", registered revision does not exist), and displays if the
> submodules contain uncommitted changes.
>
> This (among other things) allows to do git-submodule update while
> knowing exactly what will happen.
> --
> Sylvain
>
>>From 16553a9b210a956b0af961d55a9cf06f1b9b8114 Mon Sep 17 00:00:00 2001
> From: Sylvain Joyeux <sylvain.joyeux@dfki.de>
> Date: Tue, 1 Jul 2008 16:01:01 +0200
> Subject: [PATCH] more information in git-submodule status output
>
> This commit adds more information in the 'status' output of
> git-submodule. More specifically, it displays different flags if the
> submodule and the registered revision are direct parents (> and <,
> depending on which is the ancestor), if they are not direct parents (+)
> or if the registered revision cannot be found (i.e. if submodule update
> would fail, '!')
>
> Finally, it shows if the submodule contains uncommitted changes (M flag)

Which one is the commit message ;-)?

People who rely on working submodule support, do you have any feedback on
this patch?  I do not use submodule myself, so it is hard for me to judge
how much value (if any) this patch is adding to the real world use of the
status subcommand.

> @@ -97,7 +110,7 @@ for details.
>  
>  AUTHOR
>  ------
> -Written by Lars Hjemli <hjemli@gmail.com>
> +Written by Lars Hjemli <hjemli@gmail.com> and Sylvain Joyeux <sylvain.joyeux@m4x.org>

That is somehow inconsistent with what

	git-shortlog -s -n -e --no-merges git-submodule.sh 

tells me.

Honestly, I'd prefer (1) drop these "AUTHOR" lines, or (2) only list the
primary author or two.

> diff --git a/git-submodule.sh b/git-submodule.sh
> index 3eb78cc..e2b91f6 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -562,20 +566,40 @@ cmd_status()
> ...
>  		if git diff-files --quiet -- "$path"
>  		then
> -			say " $sha1 $path$revname"
> +			say " $unclean $sha1 $path$revname"
>  		else
> +                        head=$(unset GIT_DIR; cd "$path" && git rev-parse --verify HEAD)
> +                        common=$(unset GIT_DIR; cd "$path" && git merge-base HEAD $sha1)
> +                        if test -z "$common"; then
> +                            common=$(unset GIT_DIR; cd "$path" && git-fetch -q &&
> +                                    git merge-base HEAD $sha1)
> +                        fi

This "fetch" feels very wrong.  The user did not ask you to change the
state of the repository, but this will silently change the remote tracking
branches.  The repository after all might be unreachable.

  reply	other threads:[~2008-07-06  6:20 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01 15:01 [PATCH] better git-submodule status output Sylvain Joyeux
2008-07-06  6:19 ` Junio C Hamano [this message]
2008-07-06 12:57   ` Johannes Schindelin
2008-07-06 16:07     ` Sylvain Joyeux
2008-07-06 16:29       ` Johannes Schindelin
2008-07-07  6:21         ` Sylvain Joyeux
2008-07-07 14:25           ` Avery Pennarun
2008-07-07 14:34             ` Johannes Schindelin
2008-07-07 14:37               ` Johannes Schindelin
2008-07-07 14:57                 ` Sylvain Joyeux
2008-07-07 15:21                   ` Johannes Schindelin
2008-07-07 15:42                     ` Sylvain Joyeux
2008-07-07 18:20                   ` Junio C Hamano
2008-07-07 18:29                     ` Avery Pennarun
2008-07-07 19:51                       ` Junio C Hamano
2008-07-08  8:00                     ` Sylvain Joyeux
2008-07-08 11:21                       ` Johannes Schindelin
2008-07-08 12:22                         ` Sylvain Joyeux
2008-07-08 13:00                           ` Johannes Schindelin
2008-07-08 13:12                             ` Sylvain Joyeux
2008-07-07 14:57               ` Avery Pennarun
2008-07-07 15:23                 ` Johannes Schindelin
2008-07-07 15:36                   ` Avery Pennarun
2008-07-07 16:10                     ` Johannes Schindelin
2008-07-07 15:52                   ` Sylvain Joyeux
2008-07-07 15:00             ` Sylvain Joyeux
2008-07-06 13:14   ` Mark Levedahl
2008-07-09 10:13 ` Sylvain Joyeux
2008-07-09 10:25   ` Andreas Ericsson
2008-07-09 11:01     ` Sylvain Joyeux
2008-07-09 12:31   ` Johannes Schindelin
2008-07-09 13:46     ` Sylvain Joyeux
2008-07-09 13:54       ` Johannes Schindelin
2008-07-09 18:48   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2008-07-01 14:57 Sylvain Joyeux

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=7vhcb3o7q3.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=hjemli@gmail.com \
    --cc=mlevedahl@gmail.com \
    --cc=pkufranky@gmail.com \
    --cc=sylvain.joyeux@dfki.de \
    /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).