{"thread":{"id":"12197","subject":"[PATCH] API documentation for remote.h","startedAt":"2008-02-19T07:52:11Z","lastAt":"2008-02-19T07:52:11Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"69245","messageId":"alpine.LNX.1.00.0802190250170.5816@iabervon.org","threadId":"12197","inReplyTo":null,"subject":"[PATCH] API documentation for remote.h","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-19T07:52:11Z","receivedAt":"2008-02-19T07:52:11Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nSo people will find more of remote.h, primarily.\n\n Documentation/technical/api-remote.txt |  123 ++++++++++++++++++++++++++++++++\n 1 files changed, 123 insertions(+), 0 deletions(-)\n create mode 100644 Documentation/technical/api-remote.txt\n\ndiff --git a/Documentation/technical/api-remote.txt b/Documentation/technical/api-remote.txt\nnew file mode 100644\nindex 0000000..ec4790b\n--- /dev/null\n+++ b/Documentation/technical/api-remote.txt\n@@ -0,0 +1,123 @@\n+Remotes configuration API\n+=========================\n+\n+The API in remote.h gives access to the configuration related to\n+remotes. It handles all three configuration mechanisms historically\n+and currently used by git, and presents the information in a uniform\n+fashion. Note that the code also handles plain URLs without any\n+configuration, giving them just the default information.\n+\n+struct remote\n+-------------\n+\n+`name`::\n+\n+\tThe user's nickname for the remote\n+\n+`url`::\n+\n+\tAn array of all of the url_nr URLs configured for the remote\n+\n+`push`:: \n+\n+\t An array of refspecs configured for pushing, with\n+\t push_refspec being the literal strings, and push_refspec_nr\n+\t being the quantity.\n+\n+`fetch`::\n+\n+\tAn array of refspecs configured for fetching, with\n+\tfetch_refspec being the literal strings, and fetch_refspec_nr\n+\tbeing the quantity.\n+\n+`fetch_tags`::\n+\n+\tThe setting for whether to fetch tags (as a separate rule from\n+\tthe configured refspecs); -1 means never to fetch tags, 0\n+\tmeans to auto-follow tags based on the default heuristic, 1\n+\tmeans to always auto-follow tags, and 2 means to fetch all\n+\ttags.\n+\n+`receivepack`, `uploadpack`::\n+\n+\tThe configured helper programs to run on the remote side, for\n+\tgit-native protocols.\n+\n+`http_proxy`::\n+\n+\tThe proxy to use for curl (http, https, ftp, etc.) URLs.\n+\n+struct remotes can be found by name with remote_get(), and iterated\n+through with for_each_remote(). remote_get(NULL) will return the\n+default remote, given the current branch and configuration.\n+\n+struct refspec\n+--------------\n+\n+A struct refspec holds the parsed interpretation of a refspec. If it\n+will force updates (starts with a '+'), force is true. If it is a\n+pattern (sides end with '*') pattern is true. src and dest are the two\n+sides (if a pattern, only the part outside of the wildcards); if there\n+is only one side, it is src, and dst is NULL; if sides exist but are\n+empty (i.e., the refspec either starts or ends with ':'), the\n+corresponding side is \"\".\n+\n+This parsing can be done to an array of strings to give an array of\n+struct refpsecs with parse_ref_spec().\n+\n+remote_find_tracking(), given a remote and a struct refspec with\n+either src or dst filled out, will fill out the other such that the\n+result is in the \"fetch\" specification for the remote (note that this\n+evaluates patterns and returns a single result).\n+\n+struct branch\n+-------------\n+\n+Note that this may end up moving to branch.h\n+\n+struct branch holds the configuration for a branch. It can be looked\n+up with branch_get(name) for \"refs/heads/{name}\", or with\n+branch_get(NULL) for HEAD.\n+\n+It contains:\n+\n+`name`::\n+\n+\tThe short name of the branch.\n+\n+`refname`::\n+\n+\tThe full path for the branch ref.\n+\n+`remote_name`::\n+\n+\tThe name of the remote listed in the configuration.\n+\n+`remote`::\n+\n+\tThe struct remote for that remote.\n+\n+`merge_name`::\n+\n+\tAn array of the \"merge\" lines in the configuration.\n+\n+`merge`::\n+\n+\tAn array of the struct refspecs used for the merge lines. That\n+\tis, merge[i]->dst is a local tracking ref which should be\n+\tmerged into this branch by default.\n+\n+`merge_nr`::\n+\n+\tThe number of merge configurations\n+\n+branch_has_merge_config() returns true if the given branch has merge\n+configuration given.\n+\n+Other stuff\n+-----------\n+\n+There is other stuff in remote.h that is related, in general, to the\n+process of interacting with remotes.\n+\n+(Daniel Barkalow)\n-- \n1.5.4.1.1350.g2b9ee\n"}]}