summaryrefslogtreecommitdiff
path: root/refspec.h
diff options
context:
space:
mode:
authorHeba Waly <heba.waly@gmail.com>2019-11-17 21:04:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-11-18 06:21:28 (GMT)
commitd27eb356bf253be763ab08733fae723adda27e1c (patch)
treefc08851fbcb7750b3a263df8c705451f5f45677d /refspec.h
parent405c6b1fbc699a9651e3a555612fd7a31590a509 (diff)
downloadgit-d27eb356bf253be763ab08733fae723adda27e1c.zip
git-d27eb356bf253be763ab08733fae723adda27e1c.tar.gz
git-d27eb356bf253be763ab08733fae723adda27e1c.tar.bz2
remote: move doc to remote.h and refspec.h
Move the documentation from Documentation/technical/api-remote.txt to remote.h and refspec.h as it's easier for the developers to find the usage information beside the code instead of looking for it in another doc file. N.B. The doc for both push and fetch members of the remote struct aren't moved because they are out of date, as the members were changed from arrays of rspecs to struct refspec 2 years ago. Also documentation/technical/api-remote.txt is removed because the information it has is now redundant and it'll be hard to keep it up to date and synchronized with the documentation in the header file. Signed-off-by: Heba Waly <heba.waly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.h')
-rw-r--r--refspec.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/refspec.h b/refspec.h
index 9b6e64a..3f2bd4a 100644
--- a/refspec.h
+++ b/refspec.h
@@ -20,6 +20,22 @@ struct refspec_item {
#define REFSPEC_INIT_FETCH { .fetch = REFSPEC_FETCH }
#define REFSPEC_INIT_PUSH { .fetch = REFSPEC_PUSH }
+/**
+ * A struct refspec holds the parsed interpretation of a refspec. If it will
+ * force updates (starts with a '+'), force is true. If it is a pattern
+ * (sides end with '*') pattern is true. src and dest are the two sides
+ * (including '*' characters if present); if there is only one side, it is src,
+ * and dst is NULL; if sides exist but are empty (i.e., the refspec either
+ * starts or ends with ':'), the corresponding side is "".
+ *
+ * An array of strings can be parsed into an array of struct refspecs using
+ * parse_fetch_refspec() or parse_push_refspec().
+ *
+ * remote_find_tracking(), given a remote and a struct refspec with either src
+ * or dst filled out, will fill out the other such that the result is in the
+ * "fetch" specification for the remote (note that this evaluates patterns and
+ * returns a single result).
+ */
struct refspec {
struct refspec_item *items;
int alloc;