# [PATCH] git-http-fetch: remove unused cmd_http_fetch

5 messages from 2012-06-14 to 2012-06-15. Participants: Luka Perkov, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/30811

## Luka Perkov, 2012-06-14 20:23

Subject: [PATCH] git-http-fetch: remove unused cmd_http_fetch
Message-ID: <20120614202336.GA3755@w500.iskon.local>
URL: https://gitlist.dev/e/20120614202336.GA3755%40w500.iskon.local

```
It was left out from commit 1088261f6fc90324014b5306cca4171987da85ce

Signed-off-by: Luka Perkov <lists@lukaperkov.net>
---

 builtin.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/builtin.h b/builtin.h
index 338f540..f5b8ed1 100644
--- a/builtin.h
+++ b/builtin.h
@@ -83,7 +83,6 @@ extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix
 extern int cmd_grep(int argc, const char **argv, const char *prefix);
 extern int cmd_hash_object(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
-extern int cmd_http_fetch(int argc, const char **argv, const char *prefix);
 extern int cmd_index_pack(int argc, const char **argv, const char *prefix);
 extern int cmd_init_db(int argc, const char **argv, const char *prefix);
 extern int cmd_log(int argc, const char **argv, const char *prefix);

```

## Jeff King, 2012-06-15 16:21

Subject: Re: [PATCH] git-http-fetch: remove unused cmd_http_fetch
Message-ID: <20120615162136.GC4572@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20120615162136.GC4572%40sigill.intra.peff.net
In-Reply-To: <20120614202336.GA3755@w500.iskon.local>

```
On Thu, Jun 14, 2012 at 10:23:37PM +0200, Luka Perkov wrote:

> It was left out from commit 1088261f6fc90324014b5306cca4171987da85ce

This commit message left me scratching my head. Did we get rid of
http-fetch? If not, then don't we still need cmd_http_fetch? Or did we
just make it not a builtin, in which case we wouldn't be getting rid of
cmd_http_fetch, but rather converting it to main?

Reading the 1088261, I find the answer: we did make it not a builtin,
and it was indeed converted into "main". But its _declaration_ hung
around.

So maybe a better commit message would be:

  Subject: builtin.h: drop cmd_http_fetch declaration

  This was converted from a builtin into a stand-alone program by
  1088261f6fc90324014b5306cca4171987da85ce, but that commit forgot to
  drop the declaration.

Other than that, the patch looks obviously correct.

-Peff

PS There seem to be some other similar declarations: at least
   cmd_upload_tar and cmd_pickaxe.

```

## Junio C Hamano, 2012-06-15 18:09

Subject: Re: [PATCH] git-http-fetch: remove unused cmd_http_fetch
Message-ID: <7vaa04bg5q.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vaa04bg5q.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20120615162136.GC4572@sigill.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> PS There seem to be some other similar declarations: at least
>    cmd_upload_tar and cmd_pickaxe.

Thanks.

$ sed -ne 's/^extern int \(cmd_[^(]*\)(.*/\1/p' builtin.h | sort >/var/tmp/1
$ nm -g git| sed -ne 's/^[0-9a-f]* T cmd_/cmd_/p' | sort > /var/tmp/2
$ comm -3 /var/tmp/[12]

finds only the two you mentioned, so how about doing it this way?

-- >8 --
From: Luka Perkov <lists@lukaperkov.net>
Date: Thu, 14 Jun 2012 22:23:37 +0200
Subject: [PATCH] builtin.h: remove unused cmd_<foo> declarations

These were left in builtin.h after they were converted into
stand-alone programs or removed after experiments finished.

Signed-off-by: Luka Perkov <lists@lukaperkov.net>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/builtin.h b/builtin.h
index 20427d2..3e44816 100644
--- a/builtin.h
+++ b/builtin.h
@@ -58,7 +58,6 @@ extern int cmd_gc(int argc, const char **argv, const char *prefix);
 extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
 extern int cmd_grep(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
-extern int cmd_http_fetch(int argc, const char **argv, const char *prefix);
 extern int cmd_init_db(int argc, const char **argv, const char *prefix);
 extern int cmd_log(int argc, const char **argv, const char *prefix);
 extern int cmd_log_reflog(int argc, const char **argv, const char *prefix);
@@ -76,7 +75,6 @@ extern int cmd_mktree(int argc, const char **argv, const char *prefix);
 extern int cmd_mv(int argc, const char **argv, const char *prefix);
 extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
 extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
-extern int cmd_pickaxe(int argc, const char **argv, const char *prefix);
 extern int cmd_prune(int argc, const char **argv, const char *prefix);
 extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
 extern int cmd_push(int argc, const char **argv, const char *prefix);
@@ -104,7 +102,6 @@ extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
 extern int cmd_update_index(int argc, const char **argv, const char *prefix);
 extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
 extern int cmd_upload_archive(int argc, const char **argv, const char *prefix);
-extern int cmd_upload_tar(int argc, const char **argv, const char *prefix);
 extern int cmd_verify_tag(int argc, const char **argv, const char *prefix);
 extern int cmd_version(int argc, const char **argv, const char *prefix);
 extern int cmd_whatchanged(int argc, const char **argv, const char *prefix);
-- 
1.7.11.rc3.30.g3bdace2

```

## Jeff King, 2012-06-15 18:16

Subject: Re: [PATCH] git-http-fetch: remove unused cmd_http_fetch
Message-ID: <20120615181636.GA14843@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20120615181636.GA14843%40sigill.intra.peff.net
In-Reply-To: <7vaa04bg5q.fsf@alter.siamese.dyndns.org>

```
On Fri, Jun 15, 2012 at 11:09:53AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > PS There seem to be some other similar declarations: at least
> >    cmd_upload_tar and cmd_pickaxe.
> 
> Thanks.
> 
> $ sed -ne 's/^extern int \(cmd_[^(]*\)(.*/\1/p' builtin.h | sort >/var/tmp/1
> $ nm -g git| sed -ne 's/^[0-9a-f]* T cmd_/cmd_/p' | sort > /var/tmp/2
> $ comm -3 /var/tmp/[12]
> 
> finds only the two you mentioned, so how about doing it this way?

I used a slightly grosser grep that looked in "*.c", and come up with
only those 2. Patch looks good to me.

-Peff

```

## Luka Perkov, 2012-06-15 18:40

Subject: Re: [PATCH] git-http-fetch: remove unused cmd_http_fetch
Message-ID: <20120615184059.GA27940@w500.iskon.local>
URL: https://gitlist.dev/e/20120615184059.GA27940%40w500.iskon.local
In-Reply-To: <20120615162136.GC4572@sigill.intra.peff.net>

```
On Fri, Jun 15, 2012 at 12:21:36PM -0400, Jeff King wrote:
> On Thu, Jun 14, 2012 at 10:23:37PM +0200, Luka Perkov wrote:
> 
> > It was left out from commit 1088261f6fc90324014b5306cca4171987da85ce
> 
> This commit message left me scratching my head. Did we get rid of
> http-fetch? If not, then don't we still need cmd_http_fetch? Or did we
> just make it not a builtin, in which case we wouldn't be getting rid of
> cmd_http_fetch, but rather converting it to main?
> 
> Reading the 1088261, I find the answer: we did make it not a builtin,
> and it was indeed converted into "main". But its _declaration_ hung
> around.
> 
> So maybe a better commit message would be:
> 
>   Subject: builtin.h: drop cmd_http_fetch declaration
> 
>   This was converted from a builtin into a stand-alone program by
>   1088261f6fc90324014b5306cca4171987da85ce, but that commit forgot to
>   drop the declaration.

I agree. Sorry for the confusing message.

> Other than that, the patch looks obviously correct.
> 
> -Peff
> 
> PS There seem to be some other similar declarations: at least
>    cmd_upload_tar and cmd_pickaxe.

I noticed only cmd_http_fetch when I was hacking a patch for OpenWrt.

Luka

```
