git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCHv2 1/2] submodule: port resolve_relative_url from shell to C
Date: Fri, 22 Jan 2016 12:23:54 -0800	[thread overview]
Message-ID: <CAGZ79kZ9rEXmtgTpdP5uG46xbxjeboLx3_pdgvspThdebmpyOw@mail.gmail.com> (raw)
In-Reply-To: <56A27D1F.60007@kdbg.org>

On Fri, Jan 22, 2016 at 11:03 AM, Johannes Sixt <j6t@kdbg.org> wrote:
> Am 20.01.2016 um 03:03 schrieb Stefan Beller:
>> +static char *last_dir_separator(char *str)
>> +{
>> +     char *p = str + strlen(str);
>> +     while (p-- > str)
>> +             if (is_dir_sep(*p))
>> +                     return p;
>> +     return NULL;
>> +}
>> +
>
> I just noticed that we already have this function. Please squash in the
> following.

thanks for reviewing! squashed.

>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 1484b36..92d7d32 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -51,21 +51,12 @@ static int starts_with_dot_dot_slash(const char *str)
>         return str[0] == '.' && str[1] == '.' && is_dir_sep(str[2]);
>  }
>
> -static char *last_dir_separator(char *str)
> -{
> -       char *p = str + strlen(str);
> -       while (p-- > str)
> -               if (is_dir_sep(*p))
> -                       return p;
> -       return NULL;
> -}
> -
>  /*
>   * Returns 1 if it was the last chop before ':'.
>   */
>  static int chop_last_dir(char **remoteurl, int is_relative)
>  {
> -       char *rfind = last_dir_separator(*remoteurl);
> +       char *rfind = find_last_dir_sep(*remoteurl);
>         if (rfind) {
>                 *rfind = '\0';
>                 return 0;
>

  reply	other threads:[~2016-01-22 20:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 23:37 [PATCH 0/2] Port `git submodule init` from shell to C Stefan Beller
2016-01-15 23:37 ` [PATCH 1/2] submodule: Port resolve_relative_url " Stefan Beller
2016-01-15 23:37 ` [PATCH 2/2] submodule: Port init " Stefan Beller
2016-01-19 23:17 ` [PATCH 0/2] Port `git submodule init` " Junio C Hamano
2016-01-20  2:03   ` [PATCHv2 " Stefan Beller
2016-01-20  2:03     ` [PATCHv2 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-01-22 19:03       ` Johannes Sixt
2016-01-22 20:23         ` Stefan Beller [this message]
2016-01-20  2:03     ` [PATCHv2 2/2] submodule: port init " Stefan Beller
2016-01-20  3:24       ` [PATCHv3 " Stefan Beller
2016-01-20 21:01         ` Junio C Hamano
2016-01-20 22:33           ` Stefan Beller
2016-01-20 23:04             ` Junio C Hamano
2016-01-21 23:18         ` [PATCHv4 " Stefan Beller
2016-01-22 22:30           ` Junio C Hamano
2016-01-22 22:32             ` Stefan Beller
2016-01-22 23:32             ` [PATCHv3 0/2] Port `git submodule init` " Stefan Beller
2016-01-25 22:46               ` Junio C Hamano
2016-01-28  2:30                 ` [PATCHv4 " Stefan Beller
2016-01-28  2:30                   ` [PATCHv4 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-01-28 22:03                     ` Junio C Hamano
2016-01-28 22:11                       ` Stefan Beller
2016-01-28  2:30                   ` [PATCHv4 2/2] submodule: port init " Stefan Beller
2016-02-27  8:30                     ` Duy Nguyen
2016-01-22 23:32             ` [PATCHv3 1/2] submodule: port resolve_relative_url " Stefan Beller
2016-01-22 23:32             ` [PATCHv3 2/2] submodule: port init " Stefan Beller

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=CAGZ79kZ9rEXmtgTpdP5uG46xbxjeboLx3_pdgvspThdebmpyOw@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=sunshine@sunshineco.com \
    /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).