Re: [PATCH v4 08/11] connect: change the --diag-url output to separate user and host
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- May 3, 2016, 16:20 UTC
- Message-ID
- <c1cc0220-d239-1589-9957-1ef8a6245d54@web.de>
- In-Reply-To
- <1462265452-32360-9-git-send-email-mh@glandium.org>
On 2016-05-03 10.50, Mike Hommey wrote:
Show 33 quoted lines
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---
> connect.c | 6 ++----
> t/t5500-fetch-pack.sh | 14 ++++++++++++--
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/connect.c b/connect.c
> index e95e385..2c5b722 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -703,10 +703,8 @@ struct child_process *git_connect(int fd[2], const char *url,
> if (flags & CONNECT_DIAG_URL) {
> printf("Diag: url=%s\n", url ? url : "NULL");
> printf("Diag: protocol=%s\n", prot_name(protocol));
> - if (user)
> - printf("Diag: userandhost=%s@%s\n", user, host);
> - else
> - printf("Diag: userandhost=%s\n", host ? host : "NULL");
> + printf("Diag: user=%s\n", user ? user : "NULL");
> + printf("Diag: host=%s\n", host ? host : "NULL");
> printf("Diag: port=%s\n", port ? port : "NONE");
> printf("Diag: path=%s\n", path ? path : "NULL");
> conn = NULL;
> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> index 09d46c3..0c2f79f 100755
> --- a/t/t5500-fetch-pack.sh
> +++ b/t/t5500-fetch-pack.sh
> @@ -537,7 +537,7 @@ check_prot_path () {
> Diag: protocol=$2
> Diag: path=$3
> EOF
> - git fetch-pack --diag-url "$1" | grep -v host= | grep -v port= >actual &&
> + git fetch-pack --diag-url "$1" | grep -v user= | grep -v host= | grep -v port= >actual &&Running grep a couple of times is probably not optimal in terms of spawning a process.... Does
git fetch-pack --diag-url "$1" | egrep -v "user=|host=|port=" >actual && work ? or the version like this: git fetch-pack --diag-url "$1" | egrep -v "(user|host|port)=" >actual &&
(And before I forget it: The whole series makes sense, thanks for that, it may be good if I review the final result as well as all the small changes)