{"thread":{"id":"19704","subject":"[PATCH 3/3] git-parse-remote: remove unused functions","startedAt":"2009-06-05T19:53:37Z","lastAt":"2009-06-06T21:03:47Z","messageCount":3,"participants":["Santi Béjar","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"115556","messageId":"1244231617-17754-3-git-send-email-santi@agolina.net","threadId":"19704","inReplyTo":null,"subject":"[PATCH 3/3] git-parse-remote: remove unused functions","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-06-05T19:53:37Z","receivedAt":"2009-06-05T19:53:37Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"\nSigned-off-by: Santi Béjar <santi@agolina.net>\n---\n .gitignore                         |    1 -\n Documentation/git-parse-remote.txt |   50 ---------\n git-parse-remote.sh                |  204 ------------------------------------\n 3 files changed, 0 insertions(+), 255 deletions(-)\n delete mode 100644 Documentation/git-parse-remote.txt\n\ndiff --git a/.gitignore b/.gitignore\nindex 41c0b20..163998c 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -89,7 +89,6 @@ git-mv\n git-pack-redundant\n git-pack-objects\n git-pack-refs\n-git-parse-remote\n git-patch-id\n git-peek-remote\n git-prune\ndiff --git a/Documentation/git-parse-remote.txt b/Documentation/git-parse-remote.txt\ndeleted file mode 100644\nindex cd43069..0000000\n--- a/Documentation/git-parse-remote.txt\n+++ /dev/null\n@@ -1,50 +0,0 @@\n-git-parse-remote(1)\n-===================\n-\n-NAME\n-----\n-git-parse-remote - Routines to help parsing remote repository access parameters\n-\n-\n-SYNOPSIS\n---------\n-'. \"$(git --exec-path)/git-parse-remote\"'\n-\n-DESCRIPTION\n------------\n-This script is included in various scripts to supply\n-routines to parse files under $GIT_DIR/remotes/ and\n-$GIT_DIR/branches/ and configuration variables that are related\n-to fetching, pulling and pushing.\n-\n-The primary entry points are:\n-\n-get_remote_refs_for_fetch::\n-\tGiven the list of user-supplied `<repo> <refspec>...`,\n-\treturn the list of refs to fetch after canonicalizing\n-\tthem into `$GIT_DIR` relative paths\n-\t(e.g. `refs/heads/foo`).  When `<refspec>...` is empty\n-\tthe returned list of refs consists of the defaults\n-\tfor the given `<repo>`, if specified in\n-\t`$GIT_DIR/remotes/`, `$GIT_DIR/branches/`, or `remote.*.fetch`\n-\tconfiguration.\n-\n-get_remote_refs_for_push::\n-\tGiven the list of user-supplied `<repo> <refspec>...`,\n-\treturn the list of refs to push in a form suitable to be\n-\tfed to the 'git-send-pack' command.  When `<refspec>...`\n-\tis empty the returned list of refs consists of the\n-\tdefaults for the given `<repo>`, if specified in\n-\t`$GIT_DIR/remotes/`.\n-\n-Author\n-------\n-Written by Junio C Hamano.\n-\n-Documentation\n---------------\n-Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.\n-\n-GIT\n----\n-Part of the linkgit:git[1] suite\ndiff --git a/git-parse-remote.sh b/git-parse-remote.sh\nindex 5df5689..34f4b36 100644\n--- a/git-parse-remote.sh\n+++ b/git-parse-remote.sh\n@@ -60,175 +60,6 @@ get_default_remote () {\n \techo ${origin:-origin}\n }\n \n-get_remote_default_refs_for_push () {\n-\tdata_source=$(get_data_source \"$1\")\n-\tcase \"$data_source\" in\n-\t'' | branches | self)\n-\t\t;; # no default push mapping, just send matching refs.\n-\tconfig)\n-\t\tgit config --get-all \"remote.$1.push\" ;;\n-\tremotes)\n-\t\tsed -ne '/^Push: */{\n-\t\t\ts///p\n-\t\t}' \"$GIT_DIR/remotes/$1\" ;;\n-\t*)\n-\t\tdie \"internal error: get-remote-default-ref-for-push $1\" ;;\n-\tesac\n-}\n-\n-# Called from canon_refs_list_for_fetch -d \"$remote\", which\n-# is called from get_remote_default_refs_for_fetch to grok\n-# refspecs that are retrieved from the configuration, but not\n-# from get_remote_refs_for_fetch when it deals with refspecs\n-# supplied on the command line.  $ls_remote_result has the list\n-# of refs available at remote.\n-#\n-# The first token returned is either \"explicit\" or \"glob\"; this\n-# is to help prevent randomly \"globbed\" ref from being chosen as\n-# a merge candidate\n-expand_refs_wildcard () {\n-\techo \"$ls_remote_result\" |\n-\tgit fetch--tool expand-refs-wildcard \"-\" \"$@\"\n-}\n-\n-# Subroutine to canonicalize remote:local notation.\n-canon_refs_list_for_fetch () {\n-\t# If called from get_remote_default_refs_for_fetch\n-\t# leave the branches in branch.${curr_branch}.merge alone,\n-\t# or the first one otherwise; add prefix . to the rest\n-\t# to prevent the secondary branches to be merged by default.\n-\tmerge_branches=\n-\tcurr_branch=\n-\tif test \"$1\" = \"-d\"\n-\tthen\n-\t\tshift ; remote=\"$1\" ; shift\n-\t\tset $(expand_refs_wildcard \"$remote\" \"$@\")\n-\t\tis_explicit=\"$1\"\n-\t\tshift\n-\t\tif test \"$remote\" = \"$(get_default_remote)\"\n-\t\tthen\n-\t\t\tcurr_branch=$(git symbolic-ref -q HEAD | \\\n-\t\t\t    sed -e 's|^refs/heads/||')\n-\t\t\tmerge_branches=$(git config \\\n-\t\t\t    --get-all \"branch.${curr_branch}.merge\")\n-\t\tfi\n-\t\tif test -z \"$merge_branches\" && test $is_explicit != explicit\n-\t\tthen\n-\t\t\tmerge_branches=..this.will.never.match.any.ref..\n-\t\tfi\n-\tfi\n-\tfor ref\n-\tdo\n-\t\tforce=\n-\t\tcase \"$ref\" in\n-\t\t+*)\n-\t\t\tref=$(expr \"z$ref\" : 'z+\\(.*\\)')\n-\t\t\tforce=+\n-\t\t\t;;\n-\t\tesac\n-\t\texpr \"z$ref\" : 'z.*:' >/dev/null || ref=\"${ref}:\"\n-\t\tremote=$(expr \"z$ref\" : 'z\\([^:]*\\):')\n-\t\tlocal=$(expr \"z$ref\" : 'z[^:]*:\\(.*\\)')\n-\t\tdot_prefix=.\n-\t\tif test -z \"$merge_branches\"\n-\t\tthen\n-\t\t\tmerge_branches=$remote\n-\t\t\tdot_prefix=\n-\t\telse\n-\t\t\tfor merge_branch in $merge_branches\n-\t\t\tdo\n-\t\t\t    [ \"$remote\" = \"$merge_branch\" ] &&\n-\t\t\t    dot_prefix= && break\n-\t\t\tdone\n-\t\tfi\n-\t\tcase \"$remote\" in\n-\t\t'' | HEAD ) remote=HEAD ;;\n-\t\trefs/*) ;;\n-\t\theads/* | tags/* | remotes/* ) remote=\"refs/$remote\" ;;\n-\t\t*) remote=\"refs/heads/$remote\" ;;\n-\t\tesac\n-\t\tcase \"$local\" in\n-\t\t'') local= ;;\n-\t\trefs/*) ;;\n-\t\theads/* | tags/* | remotes/* ) local=\"refs/$local\" ;;\n-\t\t*) local=\"refs/heads/$local\" ;;\n-\t\tesac\n-\n-\t\tif local_ref_name=$(expr \"z$local\" : 'zrefs/\\(.*\\)')\n-\t\tthen\n-\t\t   git check-ref-format \"$local_ref_name\" ||\n-\t\t   die \"* refusing to create funny ref '$local_ref_name' locally\"\n-\t\tfi\n-\t\techo \"${dot_prefix}${force}${remote}:${local}\"\n-\tdone\n-}\n-\n-# Returns list of src: (no store), or src:dst (store)\n-get_remote_default_refs_for_fetch () {\n-\tdata_source=$(get_data_source \"$1\")\n-\tcase \"$data_source\" in\n-\t'')\n-\t\techo \"HEAD:\" ;;\n-\tself)\n-\t        canon_refs_list_for_fetch -d \"$1\" \\\n-\t\t\t$(git for-each-ref --format='%(refname):')\n-\t\t;;\n-\tconfig)\n-\t\tcanon_refs_list_for_fetch -d \"$1\" \\\n-\t\t\t$(git config --get-all \"remote.$1.fetch\") ;;\n-\tbranches)\n-\t\tremote_branch=$(sed -ne '/#/s/.*#//p' \"$GIT_DIR/branches/$1\")\n-\t\tcase \"$remote_branch\" in '') remote_branch=master ;; esac\n-\t\techo \"refs/heads/${remote_branch}:refs/heads/$1\"\n-\t\t;;\n-\tremotes)\n-\t\tcanon_refs_list_for_fetch -d \"$1\" $(sed -ne '/^Pull: */{\n-\t\t\t\t\t\ts///p\n-\t\t\t\t\t}' \"$GIT_DIR/remotes/$1\")\n-\t\t;;\n-\t*)\n-\t\tdie \"internal error: get-remote-default-ref-for-fetch $1\" ;;\n-\tesac\n-}\n-\n-get_remote_refs_for_push () {\n-\tcase \"$#\" in\n-\t0) die \"internal error: get-remote-refs-for-push.\" ;;\n-\t1) get_remote_default_refs_for_push \"$@\" ;;\n-\t*) shift; echo \"$@\" ;;\n-\tesac\n-}\n-\n-get_remote_refs_for_fetch () {\n-\tcase \"$#\" in\n-\t0)\n-\t    die \"internal error: get-remote-refs-for-fetch.\" ;;\n-\t1)\n-\t    get_remote_default_refs_for_fetch \"$@\" ;;\n-\t*)\n-\t    shift\n-\t    tag_just_seen=\n-\t    for ref\n-\t    do\n-\t\tif test \"$tag_just_seen\"\n-\t\tthen\n-\t\t    echo \"refs/tags/${ref}:refs/tags/${ref}\"\n-\t\t    tag_just_seen=\n-\t\t    continue\n-\t\telse\n-\t\t    case \"$ref\" in\n-\t\t    tag)\n-\t\t\ttag_just_seen=yes\n-\t\t\tcontinue\n-\t\t\t;;\n-\t\t    esac\n-\t\tfi\n-\t\tcanon_refs_list_for_fetch \"$ref\"\n-\t    done\n-\t    ;;\n-\tesac\n-}\n-\n get_remote_merge_branch () {\n \tcase \"$#\" in\n \t0|1)\n@@ -266,38 +97,3 @@ get_remote_merge_branch () {\n \t    ;;\n \tesac\n }\n-\n-resolve_alternates () {\n-\t# original URL (xxx.git)\n-\ttop_=`expr \"z$1\" : 'z\\([^:]*:/*[^/]*\\)/'`\n-\twhile read path\n-\tdo\n-\t\tcase \"$path\" in\n-\t\t\\#* | '')\n-\t\t\tcontinue ;;\n-\t\t/*)\n-\t\t\techo \"$top_$path/\" ;;\n-\t\t../*)\n-\t\t\t# relative -- ugly but seems to work.\n-\t\t\techo \"$1/objects/$path/\" ;;\n-\t\t*)\n-\t\t\t# exit code may not be caught by the reader.\n-\t\t\techo \"bad alternate: $path\"\n-\t\t\texit 1 ;;\n-\t\tesac\n-\tdone\n-}\n-\n-get_uploadpack () {\n-\tdata_source=$(get_data_source \"$1\")\n-\tcase \"$data_source\" in\n-\tconfig)\n-\t\tuplp=$(git config --get \"remote.$1.uploadpack\")\n-\t\techo ${uplp:-git-upload-pack}\n-\t\t;;\n-\t*)\n-\t\techo \"git-upload-pack\"\n-\t\t;;\n-\tesac\n-}\n-\n-- \n1.6.3.1.308.g426b5\n"},{"id":"115667","messageId":"7v63f9cd4s.fsf@alter.siamese.dyndns.org","threadId":"19704","inReplyTo":"1244231617-17754-3-git-send-email-santi@agolina.net","subject":"Re: [PATCH 3/3] git-parse-remote: remove unused functions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-06T20:37:23Z","receivedAt":"2009-06-06T20:37:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Santi Béjar <santi@agolina.net> writes:\n\n> Signed-off-by: Santi Béjar <santi@agolina.net>\n> ---\n>  .gitignore                         |    1 -\n>  Documentation/git-parse-remote.txt |   50 ---------\n>  git-parse-remote.sh                |  204 ------------------------------------\n>  3 files changed, 0 insertions(+), 255 deletions(-)\n>  delete mode 100644 Documentation/git-parse-remote.txt\n\nI do not understand this patch.\n\nWith this patch remove git-parse-remote from .gitignore (as if the entire\nfile is going away) and its documentation (again as if the entire file is\ngoing away), so naturally I would have expected to see removal of the file\nin the patch as well (and that means Makefile needs to be touched), but\nthat is not what is happening.\n"},{"id":"115670","messageId":"adf1fd3d0906061403sd13200co286e986c67135f4b@mail.gmail.com","threadId":"19704","inReplyTo":"7v63f9cd4s.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] git-parse-remote: remove unused functions","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2009-06-06T21:03:47Z","receivedAt":"2009-06-06T21:03:47Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"2009/6/6 Junio C Hamano <gitster@pobox.com>:\n> Santi Béjar <santi@agolina.net> writes:\n>\n>> Signed-off-by: Santi Béjar <santi@agolina.net>\n>> ---\n>>  .gitignore                         |    1 -\n>>  Documentation/git-parse-remote.txt |   50 ---------\n>>  git-parse-remote.sh                |  204 ------------------------------------\n>>  3 files changed, 0 insertions(+), 255 deletions(-)\n>>  delete mode 100644 Documentation/git-parse-remote.txt\n>\n> I do not understand this patch.\n>\n> With this patch remove git-parse-remote from .gitignore (as if the entire\n> file is going away)\n\nOps, the .gitignore removal was a mistake.\n\n> and its documentation (again as if the entire file is\n> going away), so naturally I would have expected to see removal of the file\n> in the patch as well (and that means Makefile needs to be touched), but\n> that is not what is happening.\n\nI just wanted to remove the unused functions, and their documentation.\nBut I was removing the two functions that were documented, so I\nremoved all the file. Maybe I can just remove their documentation and\nleave the rest of the file.\n\nSanti\n"}]}