git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torgil Svensson" <torgil.svensson@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: [PATCH] submodule update - don't run git-fetch if sha1 available
Date: Sat, 11 Aug 2007 20:23:12 +0200	[thread overview]
Message-ID: <e7bda7770708111123m6e497450yaa91ccb600d37d53@mail.gmail.com> (raw)
In-Reply-To: <e7bda7770708111048s77fbf416k9d0352486aee6b4a@mail.gmail.com>

Hi

Sorry for a broken patch [inserted line-feeds]. If anyone knows how to
disable that in gmail web client, please let me know.

I also tried to follow "Using msmtp to send your patches"
[http://git.or.cz/gitwiki/GitTips ] on msys/mingw/WindowsXP with the
following result (at best) from git-send-email:

"Can't call method "mail" on an undefined value at
C:/msysgit/git/git-send-email line 551."

So I would appreciate if someone that has used the combination gmail
SMTP+Windows+git-send-email successfully (cygwin,msys or "pure") to
let us know how you did it.

Best Regards,

//Torgil


On 8/11/07, Torgil Svensson <torgil.svensson@gmail.com> wrote:
> It's un-necessary (both time-consuming and annoying if you are
> disconnected) for git submodule update to always running git-fetch
> prior to the detached head checkout of the submodule if the commit
> already exists.
>
> Signed-off-by: Torgil Svensson <torgil.svensson@gmail.com>
> ---
>  git-submodule.sh |    9 +++++++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 2cfeadd..dc2ed4b 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -39,6 +39,11 @@ get_repo_base() {
>         ) 2>/dev/null
>  }
>
> +has_sha1()
> +{
> +       git rev-list 2>/dev/null --max-count=0 $1
> +}
> +
>  #
>  # Map submodule path to submodule name
>  #
> @@ -193,9 +198,9 @@ modules_update()
>
>                 if test "$subsha1" != "$sha1"
>                 then
> -                       (unset GIT_DIR && cd "$path" && git-fetch &&
> +                       (unset GIT_DIR && cd "$path" && (has_sha1
> "$sha1" || git-fetch) &&
>                                 git-checkout -q "$sha1") ||
> -                       die "Unable to checkout '$sha1' in submodule
> path '$path'"
> +                       die "Unable to checkout '$sha1' in submodule
> path '$path'"
>
>                         say "Submodule path '$path': checked out '$sha1'"
>                 fi
> --
> 1.5.3.rc4.730.ga8c3-dirty
>

  reply	other threads:[~2007-08-11 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-11 17:48 [PATCH] submodule update - don't run git-fetch if sha1 available Torgil Svensson
2007-08-11 18:23 ` Torgil Svensson [this message]
2007-08-11 19:44 ` Junio C Hamano
2007-08-12  0:03   ` Torgil Svensson
2007-08-12  1:19     ` Junio C Hamano
2007-08-19 18:57       ` Torgil Svensson
2007-08-19 20:56         ` Junio C Hamano

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=e7bda7770708111123m6e497450yaa91ccb600d37d53@mail.gmail.com \
    --to=torgil.svensson@gmail.com \
    --cc=git@vger.kernel.org \
    /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).