Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb27d29

Browse files
author
Vicent Marti
committed
Merge pull request libgit2#2396 from libgit2/cmn/docstuff
Documentation formatting fixes
2 parents 69a1a69 + dedfc73 commit eb27d29

File tree

5 files changed

+89
-86
lines changed

5 files changed

+89
-86
lines changed

include/git2/checkout.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ GIT_BEGIN_DECL
4343
* In between those are `GIT_CHECKOUT_SAFE` and `GIT_CHECKOUT_SAFE_CREATE`
4444
* both of which only make modifications that will not lose changes.
4545
*
46-
* | target == baseline | target != baseline |
47-
* ---------------------|-----------------------|----------------------|
48-
* workdir == baseline | no action | create, update, or |
49-
* | | delete file |
50-
* ---------------------|-----------------------|----------------------|
51-
* workdir exists and | no action | conflict (notify |
52-
* is != baseline | notify dirty MODIFIED | and cancel checkout) |
53-
* ---------------------|-----------------------|----------------------|
54-
* workdir missing, | create if SAFE_CREATE | create file |
55-
* baseline present | notify dirty DELETED | |
56-
* ---------------------|-----------------------|----------------------|
46+
* | target == baseline | target != baseline |
47+
* ---------------------|-----------------------|----------------------|
48+
* workdir == baseline | no action | create, update, or |
49+
* | | delete file |
50+
* ---------------------|-----------------------|----------------------|
51+
* workdir exists and | no action | conflict (notify |
52+
* is != baseline | notify dirty MODIFIED | and cancel checkout) |
53+
* ---------------------|-----------------------|----------------------|
54+
* workdir missing, | create if SAFE_CREATE | create file |
55+
* baseline present | notify dirty DELETED | |
56+
* ---------------------|-----------------------|----------------------|
5757
*
5858
* The only difference between SAFE and SAFE_CREATE is that SAFE_CREATE
5959
* will cause a file to be checked out if it is missing from the working
@@ -106,7 +106,7 @@ GIT_BEGIN_DECL
106106
* target contains that file.
107107
*/
108108
typedef enum {
109-
GIT_CHECKOUT_NONE = 0, /** default is a dry run, no actual updates */
109+
GIT_CHECKOUT_NONE = 0, /**< default is a dry run, no actual updates */
110110

111111
/** Allow safe updates that cannot overwrite uncommitted data */
112112
GIT_CHECKOUT_SAFE = (1u << 0),

include/git2/diff.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ typedef struct git_diff git_diff;
212212
* considered reserved for internal or future use.
213213
*/
214214
typedef enum {
215-
GIT_DIFF_FLAG_BINARY = (1u << 0), /** file(s) treated as binary data */
216-
GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /** file(s) treated as text data */
217-
GIT_DIFF_FLAG_VALID_ID = (1u << 2), /** `id` value is known correct */
215+
GIT_DIFF_FLAG_BINARY = (1u << 0), /**< file(s) treated as binary data */
216+
GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */
217+
GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */
218218
} git_diff_flag_t;
219219

220220
/**
@@ -228,15 +228,15 @@ typedef enum {
228228
* DELETED pairs).
229229
*/
230230
typedef enum {
231-
GIT_DELTA_UNMODIFIED = 0, /** no changes */
232-
GIT_DELTA_ADDED = 1, /** entry does not exist in old version */
233-
GIT_DELTA_DELETED = 2, /** entry does not exist in new version */
234-
GIT_DELTA_MODIFIED = 3, /** entry content changed between old and new */
235-
GIT_DELTA_RENAMED = 4, /** entry was renamed between old and new */
236-
GIT_DELTA_COPIED = 5, /** entry was copied from another old entry */
237-
GIT_DELTA_IGNORED = 6, /** entry is ignored item in workdir */
238-
GIT_DELTA_UNTRACKED = 7, /** entry is untracked item in workdir */
239-
GIT_DELTA_TYPECHANGE = 8, /** type of entry changed between old and new */
231+
GIT_DELTA_UNMODIFIED = 0, /**< no changes */
232+
GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */
233+
GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */
234+
GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */
235+
GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */
236+
GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */
237+
GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */
238+
GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
239+
GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
240240
} git_delta_t;
241241

242242
/**
@@ -416,12 +416,12 @@ typedef int (*git_diff_file_cb)(
416416
*/
417417
typedef struct git_diff_hunk git_diff_hunk;
418418
struct git_diff_hunk {
419-
int old_start; /** Starting line number in old_file */
420-
int old_lines; /** Number of lines in old_file */
421-
int new_start; /** Starting line number in new_file */
422-
int new_lines; /** Number of lines in new_file */
423-
size_t header_len; /** Number of bytes in header text */
424-
char header[128]; /** Header text, NUL-byte terminated */
419+
int old_start; /**< Starting line number in old_file */
420+
int old_lines; /**< Number of lines in old_file */
421+
int new_start; /**< Starting line number in new_file */
422+
int new_lines; /**< Number of lines in new_file */
423+
size_t header_len; /**< Number of bytes in header text */
424+
char header[128]; /**< Header text, NUL-byte terminated */
425425
};
426426

427427
/**
@@ -464,13 +464,13 @@ typedef enum {
464464
*/
465465
typedef struct git_diff_line git_diff_line;
466466
struct git_diff_line {
467-
char origin; /** A git_diff_line_t value */
468-
int old_lineno; /** Line number in old file or -1 for added line */
469-
int new_lineno; /** Line number in new file or -1 for deleted line */
470-
int num_lines; /** Number of newline characters in content */
471-
size_t content_len; /** Number of bytes of data */
472-
git_off_t content_offset; /** Offset in the original file to the content */
473-
const char *content; /** Pointer to diff text, not NUL-byte terminated */
467+
char origin; /**< A git_diff_line_t value */
468+
int old_lineno; /**< Line number in old file or -1 for added line */
469+
int new_lineno; /**< Line number in new file or -1 for deleted line */
470+
int num_lines; /**< Number of newline characters in content */
471+
size_t content_len; /**< Number of bytes of data */
472+
git_off_t content_offset; /**< Offset in the original file to the content */
473+
const char *content; /**< Pointer to diff text, not NUL-byte terminated */
474474
};
475475

476476
/**
@@ -482,10 +482,10 @@ struct git_diff_line {
482482
* of lines of file and hunk headers.
483483
*/
484484
typedef int (*git_diff_line_cb)(
485-
const git_diff_delta *delta, /** delta that contains this data */
486-
const git_diff_hunk *hunk, /** hunk containing this data */
487-
const git_diff_line *line, /** line data */
488-
void *payload); /** user reference data */
485+
const git_diff_delta *delta, /**< delta that contains this data */
486+
const git_diff_hunk *hunk, /**< hunk containing this data */
487+
const git_diff_line *line, /**< line data */
488+
void *payload); /**< user reference data */
489489

490490
/**
491491
* Flags to control the behavior of diff rename/copy detection.

include/git2/index.h

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ typedef struct git_index_entry {
7373
*/
7474
#define GIT_IDXENTRY_NAMEMASK (0x0fff)
7575
#define GIT_IDXENTRY_STAGEMASK (0x3000)
76-
#define GIT_IDXENTRY_EXTENDED (0x4000)
77-
#define GIT_IDXENTRY_VALID (0x8000)
7876
#define GIT_IDXENTRY_STAGESHIFT 12
7977

78+
typedef enum {
79+
GIT_IDXENTRY_EXTENDED = (0x4000),
80+
GIT_IDXENTRY_VALID = (0x8000),
81+
} git_indxentry_flag_t;
82+
8083
#define GIT_IDXENTRY_STAGE(E) \
8184
(((E)->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT)
8285

@@ -92,36 +95,36 @@ typedef struct git_index_entry {
9295
* in-memory only and used by libgit2. Only the flags in
9396
* `GIT_IDXENTRY_EXTENDED_FLAGS` will get saved on-disk.
9497
*
95-
* These bitmasks match the three fields in the `git_index_entry`
96-
* `flags_extended` value that belong on disk. You can use them to
97-
* interpret the data in the `flags_extended`.
98+
* Thee first three bitmasks match the three fields in the
99+
* `git_index_entry` `flags_extended` value that belong on disk. You
100+
* can use them to interpret the data in the `flags_extended`.
101+
*
102+
* The rest of the bitmasks match the other fields in the `git_index_entry`
103+
* `flags_extended` value that are only used in-memory by libgit2.
104+
* You can use them to interpret the data in the `flags_extended`.
105+
*
98106
*/
99-
#define GIT_IDXENTRY_INTENT_TO_ADD (1 << 13)
100-
#define GIT_IDXENTRY_SKIP_WORKTREE (1 << 14)
101-
/* GIT_IDXENTRY_EXTENDED2 is reserved for future extension */
102-
#define GIT_IDXENTRY_EXTENDED2 (1 << 15)
107+
typedef enum {
103108

104-
#define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_IDXENTRY_INTENT_TO_ADD | GIT_IDXENTRY_SKIP_WORKTREE)
109+
GIT_IDXENTRY_INTENT_TO_ADD = (1 << 13),
110+
GIT_IDXENTRY_SKIP_WORKTREE = (1 << 14),
111+
/** Reserved for future extension */
112+
GIT_IDXENTRY_EXTENDED2 = (1 << 15),
105113

106-
/**
107-
* Bitmasks for in-memory only fields of `git_index_entry`'s `flags_extended`
108-
*
109-
* These bitmasks match the other fields in the `git_index_entry`
110-
* `flags_extended` value that are only used in-memory by libgit2. You
111-
* can use them to interpret the data in the `flags_extended`.
112-
*/
113-
#define GIT_IDXENTRY_UPDATE (1 << 0)
114-
#define GIT_IDXENTRY_REMOVE (1 << 1)
115-
#define GIT_IDXENTRY_UPTODATE (1 << 2)
116-
#define GIT_IDXENTRY_ADDED (1 << 3)
114+
GIT_IDXENTRY_EXTENDED_FLAGS = (GIT_IDXENTRY_INTENT_TO_ADD | GIT_IDXENTRY_SKIP_WORKTREE),
115+
GIT_IDXENTRY_UPDATE = (1 << 0),
116+
GIT_IDXENTRY_REMOVE = (1 << 1),
117+
GIT_IDXENTRY_UPTODATE = (1 << 2),
118+
GIT_IDXENTRY_ADDED = (1 << 3),
117119

118-
#define GIT_IDXENTRY_HASHED (1 << 4)
119-
#define GIT_IDXENTRY_UNHASHED (1 << 5)
120-
#define GIT_IDXENTRY_WT_REMOVE (1 << 6) /* remove in work directory */
121-
#define GIT_IDXENTRY_CONFLICTED (1 << 7)
120+
GIT_IDXENTRY_HASHED = (1 << 4),
121+
GIT_IDXENTRY_UNHASHED = (1 << 5),
122+
GIT_IDXENTRY_WT_REMOVE = (1 << 6), /**< remove in work directory */
123+
GIT_IDXENTRY_CONFLICTED = (1 << 7),
122124

123-
#define GIT_IDXENTRY_UNPACKED (1 << 8)
124-
#define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
125+
GIT_IDXENTRY_UNPACKED = (1 << 8),
126+
GIT_IDXENTRY_NEW_SKIP_WORKTREE = (1 << 9),
127+
} git_idxentry_extended_flag_t;
125128

126129
/** Capabilities of system that affect index actions. */
127130
typedef enum {
@@ -412,10 +415,10 @@ GIT_EXTERN(int) git_index_add(git_index *index, const git_index_entry *source_en
412415
*
413416
* This entry is calculated from the entry's flag attribute like this:
414417
*
415-
* (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
418+
* (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
416419
*
417420
* @param entry The entry
418-
* @returns the stage number
421+
* @return the stage number
419422
*/
420423
GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
421424

include/git2/reset.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ GIT_BEGIN_DECL
1919
* Kinds of reset operation
2020
*/
2121
typedef enum {
22-
GIT_RESET_SOFT = 1, /** Move the head to the given commit */
23-
GIT_RESET_MIXED = 2, /** SOFT plus reset index to the commit */
24-
GIT_RESET_HARD = 3, /** MIXED plus changes in working tree discarded */
22+
GIT_RESET_SOFT = 1, /**< Move the head to the given commit */
23+
GIT_RESET_MIXED = 2, /**< SOFT plus reset index to the commit */
24+
GIT_RESET_HARD = 3, /**< MIXED plus changes in working tree discarded */
2525
} git_reset_t;
2626

2727
/**

include/git2/types.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ typedef struct git_packbuilder git_packbuilder;
154154

155155
/** Time in a signature */
156156
typedef struct git_time {
157-
git_time_t time; /** time in seconds from epoch */
158-
int offset; /** timezone offset, in minutes */
157+
git_time_t time; /**< time in seconds from epoch */
158+
int offset; /**< timezone offset, in minutes */
159159
} git_time;
160160

161161
/** An action signature (e.g. for committers, taggers, etc) */
162162
typedef struct git_signature {
163-
char *name; /** full name of the author */
164-
char *email; /** email of the author */
165-
git_time when; /** time when the action happened */
163+
char *name; /**< full name of the author */
164+
char *email; /**< email of the author */
165+
git_time when; /**< time when the action happened */
166166
} git_signature;
167167

168168
/** In-memory representation of a reference. */
@@ -183,9 +183,9 @@ typedef struct git_status_list git_status_list;
183183

184184
/** Basic type of any Git reference. */
185185
typedef enum {
186-
GIT_REF_INVALID = 0, /** Invalid reference */
187-
GIT_REF_OID = 1, /** A reference which points at an object id */
188-
GIT_REF_SYMBOLIC = 2, /** A reference which points at another reference */
186+
GIT_REF_INVALID = 0, /**< Invalid reference */
187+
GIT_REF_OID = 1, /**< A reference which points at an object id */
188+
GIT_REF_SYMBOLIC = 2, /**< A reference which points at another reference */
189189
GIT_REF_LISTALL = GIT_REF_OID|GIT_REF_SYMBOLIC,
190190
} git_ref_t;
191191

@@ -314,12 +314,12 @@ typedef enum {
314314
* when we don't want any particular ignore rule to be specified.
315315
*/
316316
typedef enum {
317-
GIT_SUBMODULE_IGNORE_RESET = -1, /* reset to on-disk value */
317+
GIT_SUBMODULE_IGNORE_RESET = -1, /**< reset to on-disk value */
318318

319-
GIT_SUBMODULE_IGNORE_NONE = 1, /* any change or untracked == dirty */
320-
GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /* dirty if tracked files change */
321-
GIT_SUBMODULE_IGNORE_DIRTY = 3, /* only dirty if HEAD moved */
322-
GIT_SUBMODULE_IGNORE_ALL = 4, /* never dirty */
319+
GIT_SUBMODULE_IGNORE_NONE = 1, /**< any change or untracked == dirty */
320+
GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */
321+
GIT_SUBMODULE_IGNORE_DIRTY = 3, /**< only dirty if HEAD moved */
322+
GIT_SUBMODULE_IGNORE_ALL = 4, /**< never dirty */
323323

324324
GIT_SUBMODULE_IGNORE_DEFAULT = 0
325325
} git_submodule_ignore_t;

0 commit comments

Comments
 (0)