git-http-fetch: remove unused cmd_http_fetch
PATCH 1/1 git-http-fetch: remove unused cmd_http_fetch
It was left out from commit 1088261f6fc90324014b5306cca4171987da85ce
---
builtin.h | 1 - 1 file changed, 1 deletion(-)
builtin.h +0 -1
@@ -83,7 +83,6 @@ extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefixextern 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);
Quoted 1 line · Luka Perkov
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.
Quoted 13 lines · Jeff King
Quoted 1 line · Luka Perkov
It was left out from commit
1088261f6fc90324014b5306cca4171987da85ceThis 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 ofcmd_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.
Quoted 7 lines
So maybe a better commit message would be:
Subject:
builtin.h: dropcmd_http_fetchdeclarationThis 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.
Quoted 6 lines
Other than that, the patch looks obviously correct.
-Peff
PS There seem to be some other similar declarations: at least
cmd_upload_tarandcmd_pickaxe.
I noticed only cmd_http_fetch when I was hacking a patch for OpenWrt.
Luka
Quoted 2 lines · Jeff King
PS There seem to be some other similar declarations: at least
cmd_upload_tarandcmd_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 <[email protected]>
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.
--- builtin.h | 3 --- 1 file changed, 3 deletions(-)
builtin.h +0 -3
@@ -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);
Signature · 1 line
1.7.11.rc3.30.g3bdace2
Quoted 5 lines · Junio C Hamano
Quoted 2 lines · Jeff King
PS There seem to be some other similar declarations: at least
cmd_upload_tarandcmd_pickaxe.
Quoted 7 lines
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