| Junio C Hamano | 6d559fc | 2008-02-20 10:44:26 | [diff] [blame] | 1 | Remotes configuration API | 
|  | 2 | ========================= | 
|  | 3 |  | 
|  | 4 | The API in remote.h gives access to the configuration related to | 
|  | 5 | remotes. It handles all three configuration mechanisms historically | 
|  | 6 | and currently used by git, and presents the information in a uniform | 
|  | 7 | fashion. Note that the code also handles plain URLs without any | 
|  | 8 | configuration, giving them just the default information. | 
|  | 9 |  | 
|  | 10 | struct remote | 
|  | 11 | ------------- | 
|  | 12 |  | 
|  | 13 | `name`:: | 
|  | 14 |  | 
|  | 15 | The user's nickname for the remote | 
|  | 16 |  | 
|  | 17 | `url`:: | 
|  | 18 |  | 
|  | 19 | An array of all of the url_nr URLs configured for the remote | 
|  | 20 |  | 
| Junio C Hamano | 0e88f3e | 2009-06-21 08:03:25 | [diff] [blame] | 21 | `pushurl`:: | 
|  | 22 |  | 
|  | 23 | An array of all of the pushurl_nr push URLs configured for the remote | 
|  | 24 |  | 
| Junio C Hamano | 6d559fc | 2008-02-20 10:44:26 | [diff] [blame] | 25 | `push`:: | 
|  | 26 |  | 
|  | 27 | An array of refspecs configured for pushing, with | 
|  | 28 | push_refspec being the literal strings, and push_refspec_nr | 
|  | 29 | being the quantity. | 
|  | 30 |  | 
|  | 31 | `fetch`:: | 
|  | 32 |  | 
|  | 33 | An array of refspecs configured for fetching, with | 
|  | 34 | fetch_refspec being the literal strings, and fetch_refspec_nr | 
|  | 35 | being the quantity. | 
|  | 36 |  | 
|  | 37 | `fetch_tags`:: | 
|  | 38 |  | 
|  | 39 | The setting for whether to fetch tags (as a separate rule from | 
|  | 40 | the configured refspecs); -1 means never to fetch tags, 0 | 
|  | 41 | means to auto-follow tags based on the default heuristic, 1 | 
|  | 42 | means to always auto-follow tags, and 2 means to fetch all | 
|  | 43 | tags. | 
|  | 44 |  | 
|  | 45 | `receivepack`, `uploadpack`:: | 
|  | 46 |  | 
|  | 47 | The configured helper programs to run on the remote side, for | 
|  | 48 | git-native protocols. | 
|  | 49 |  | 
|  | 50 | `http_proxy`:: | 
|  | 51 |  | 
|  | 52 | The proxy to use for curl (http, https, ftp, etc.) URLs. | 
|  | 53 |  | 
|  | 54 | struct remotes can be found by name with remote_get(), and iterated | 
|  | 55 | through with for_each_remote(). remote_get(NULL) will return the | 
|  | 56 | default remote, given the current branch and configuration. | 
|  | 57 |  | 
|  | 58 | struct refspec | 
|  | 59 | -------------- | 
|  | 60 |  | 
|  | 61 | A struct refspec holds the parsed interpretation of a refspec. If it | 
|  | 62 | will force updates (starts with a '+'), force is true. If it is a | 
|  | 63 | pattern (sides end with '*') pattern is true. src and dest are the two | 
|  | 64 | sides (if a pattern, only the part outside of the wildcards); if there | 
|  | 65 | is only one side, it is src, and dst is NULL; if sides exist but are | 
|  | 66 | empty (i.e., the refspec either starts or ends with ':'), the | 
|  | 67 | corresponding side is "". | 
|  | 68 |  | 
|  | 69 | This parsing can be done to an array of strings to give an array of | 
|  | 70 | struct refpsecs with parse_ref_spec(). | 
|  | 71 |  | 
|  | 72 | remote_find_tracking(), given a remote and a struct refspec with | 
|  | 73 | either src or dst filled out, will fill out the other such that the | 
|  | 74 | result is in the "fetch" specification for the remote (note that this | 
|  | 75 | evaluates patterns and returns a single result). | 
|  | 76 |  | 
|  | 77 | struct branch | 
|  | 78 | ------------- | 
|  | 79 |  | 
|  | 80 | Note that this may end up moving to branch.h | 
|  | 81 |  | 
|  | 82 | struct branch holds the configuration for a branch. It can be looked | 
|  | 83 | up with branch_get(name) for "refs/heads/{name}", or with | 
|  | 84 | branch_get(NULL) for HEAD. | 
|  | 85 |  | 
|  | 86 | It contains: | 
|  | 87 |  | 
|  | 88 | `name`:: | 
|  | 89 |  | 
|  | 90 | The short name of the branch. | 
|  | 91 |  | 
|  | 92 | `refname`:: | 
|  | 93 |  | 
|  | 94 | The full path for the branch ref. | 
|  | 95 |  | 
|  | 96 | `remote_name`:: | 
|  | 97 |  | 
|  | 98 | The name of the remote listed in the configuration. | 
|  | 99 |  | 
|  | 100 | `remote`:: | 
|  | 101 |  | 
|  | 102 | The struct remote for that remote. | 
|  | 103 |  | 
|  | 104 | `merge_name`:: | 
|  | 105 |  | 
|  | 106 | An array of the "merge" lines in the configuration. | 
|  | 107 |  | 
|  | 108 | `merge`:: | 
|  | 109 |  | 
|  | 110 | An array of the struct refspecs used for the merge lines. That | 
|  | 111 | is, merge[i]->dst is a local tracking ref which should be | 
|  | 112 | merged into this branch by default. | 
|  | 113 |  | 
|  | 114 | `merge_nr`:: | 
|  | 115 |  | 
|  | 116 | The number of merge configurations | 
|  | 117 |  | 
|  | 118 | branch_has_merge_config() returns true if the given branch has merge | 
|  | 119 | configuration given. | 
|  | 120 |  | 
|  | 121 | Other stuff | 
|  | 122 | ----------- | 
|  | 123 |  | 
|  | 124 | There is other stuff in remote.h that is related, in general, to the | 
|  | 125 | process of interacting with remotes. | 
|  | 126 |  | 
|  | 127 | (Daniel Barkalow) |