]> git.proxmox.com Git - libgit2.git/blame - include/git2/deprecated.h
Merge https://salsa.debian.org/debian/libgit2 into proxmox/bullseye
[libgit2.git] / include / git2 / deprecated.h
CommitLineData
ac3d33df
JK
1/*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7#ifndef INCLUDE_git_deprecated_h__
8#define INCLUDE_git_deprecated_h__
9
22a2d3d5
UG
10#include "attr.h"
11#include "config.h"
ac3d33df 12#include "common.h"
22a2d3d5 13#include "blame.h"
ac3d33df 14#include "buffer.h"
22a2d3d5
UG
15#include "checkout.h"
16#include "cherrypick.h"
17#include "clone.h"
18#include "describe.h"
19#include "diff.h"
ac3d33df 20#include "errors.h"
c25aa7cd 21#include "filter.h"
ac3d33df 22#include "index.h"
22a2d3d5
UG
23#include "indexer.h"
24#include "merge.h"
ac3d33df 25#include "object.h"
22a2d3d5 26#include "proxy.h"
ac3d33df 27#include "refs.h"
22a2d3d5
UG
28#include "rebase.h"
29#include "remote.h"
30#include "trace.h"
31#include "repository.h"
32#include "revert.h"
c25aa7cd 33#include "revparse.h"
22a2d3d5
UG
34#include "stash.h"
35#include "status.h"
36#include "submodule.h"
37#include "worktree.h"
38#include "credential.h"
39#include "credential_helpers.h"
ac3d33df
JK
40
41/*
42 * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
43 */
44#ifndef GIT_DEPRECATE_HARD
45
22a2d3d5
UG
46/*
47 * The credential structures are now opaque by default, and their
48 * definition has moved into the `sys/credential.h` header; include
49 * them here for backward compatibility.
50 */
51#include "sys/credential.h"
52
ac3d33df
JK
53/**
54 * @file git2/deprecated.h
55 * @brief libgit2 deprecated functions and values
56 * @ingroup Git
57 * @{
58 */
59GIT_BEGIN_DECL
60
22a2d3d5
UG
61/** @name Deprecated Attribute Constants
62 *
63 * These enumeration values are retained for backward compatibility.
64 * The newer versions of these functions should be preferred in all
65 * new code.
66 *
67 * There is no plan to remove these backward compatibility values at
68 * this time.
69 */
70/**@{*/
71
72#define GIT_ATTR_UNSPECIFIED_T GIT_ATTR_VALUE_UNSPECIFIED
73#define GIT_ATTR_TRUE_T GIT_ATTR_VALUE_TRUE
74#define GIT_ATTR_FALSE_T GIT_ATTR_VALUE_FALSE
75#define GIT_ATTR_VALUE_T GIT_ATTR_VALUE_STRING
76
77#define GIT_ATTR_TRUE(attr) GIT_ATTR_IS_TRUE(attr)
78#define GIT_ATTR_FALSE(attr) GIT_ATTR_IS_FALSE(attr)
79#define GIT_ATTR_UNSPECIFIED(attr) GIT_ATTR_IS_UNSPECIFIED(attr)
80
81typedef git_attr_value_t git_attr_t;
82
83/**@}*/
84
c25aa7cd 85/** @name Deprecated Blob Functions and Constants
22a2d3d5 86 *
c25aa7cd
PP
87 * These functions and enumeration values are retained for backward
88 * compatibility. The newer versions of these functions and values
89 * should be preferred in all new code.
22a2d3d5
UG
90 *
91 * There is no plan to remove these backward compatibility values at
92 * this time.
93 */
94/**@{*/
95
c25aa7cd
PP
96#define GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD
97
22a2d3d5
UG
98GIT_EXTERN(int) git_blob_create_fromworkdir(git_oid *id, git_repository *repo, const char *relative_path);
99GIT_EXTERN(int) git_blob_create_fromdisk(git_oid *id, git_repository *repo, const char *path);
100GIT_EXTERN(int) git_blob_create_fromstream(
101 git_writestream **out,
102 git_repository *repo,
103 const char *hintpath);
104GIT_EXTERN(int) git_blob_create_fromstream_commit(
105 git_oid *out,
106 git_writestream *stream);
107GIT_EXTERN(int) git_blob_create_frombuffer(
108 git_oid *id, git_repository *repo, const void *buffer, size_t len);
109
110/** Deprecated in favor of `git_blob_filter`.
111 *
112 * @deprecated Use git_blob_filter
113 * @see git_blob_filter
114 */
115GIT_EXTERN(int) git_blob_filtered_content(
116 git_buf *out,
117 git_blob *blob,
118 const char *as_path,
119 int check_for_binary_data);
120
121/**@}*/
122
c25aa7cd
PP
123/** @name Deprecated Filter Functions
124 *
125 * These functions are retained for backward compatibility. The
126 * newer versions of these functions should be preferred in all
127 * new code.
128 *
129 * There is no plan to remove these backward compatibility values at
130 * this time.
131 */
132/**@{*/
133
134/** Deprecated in favor of `git_filter_list_stream_buffer`.
135 *
136 * @deprecated Use git_filter_list_stream_buffer
137 * @see Use git_filter_list_stream_buffer
138 */
139GIT_EXTERN(int) git_filter_list_stream_data(
140 git_filter_list *filters,
141 git_buf *data,
142 git_writestream *target);
143
144/** Deprecated in favor of `git_filter_list_apply_to_buffer`.
145 *
146 * @deprecated Use git_filter_list_apply_to_buffer
147 * @see Use git_filter_list_apply_to_buffer
148 */
149GIT_EXTERN(int) git_filter_list_apply_to_data(
150 git_buf *out,
151 git_filter_list *filters,
152 git_buf *in);
153
154/**@}*/
155
156/** @name Deprecated Tree Functions
157 *
158 * These functions are retained for backward compatibility. The
159 * newer versions of these functions and values should be preferred
160 * in all new code.
161 *
162 * There is no plan to remove these backward compatibility values at
163 * this time.
164 */
165/**@{*/
166
167/**
168 * Write the contents of the tree builder as a tree object.
169 * This is an alias of `git_treebuilder_write` and is preserved
170 * for backward compatibility.
171 *
172 * This function is deprecated, but there is no plan to remove this
173 * function at this time.
174 *
175 * @deprecated Use git_treebuilder_write
176 * @see git_treebuilder_write
177 */
178GIT_EXTERN(int) git_treebuilder_write_with_buffer(
179 git_oid *oid, git_treebuilder *bld, git_buf *tree);
180
181/**@}*/
182
ac3d33df
JK
183/** @name Deprecated Buffer Functions
184 *
185 * These functions and enumeration values are retained for backward
186 * compatibility. The newer versions of these functions should be
187 * preferred in all new code.
188 *
189 * There is no plan to remove these backward compatibility values at
190 * this time.
191 */
192/**@{*/
193
c25aa7cd
PP
194/**
195 * Static initializer for git_buf from static buffer
196 */
197#define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
198
199/**
200 * Resize the buffer allocation to make more space.
201 *
202 * This will attempt to grow the buffer to accommodate the target size.
203 *
204 * If the buffer refers to memory that was not allocated by libgit2 (i.e.
205 * the `asize` field is zero), then `ptr` will be replaced with a newly
206 * allocated block of data. Be careful so that memory allocated by the
207 * caller is not lost. As a special variant, if you pass `target_size` as
208 * 0 and the memory is not allocated by libgit2, this will allocate a new
209 * buffer of size `size` and copy the external data into it.
210 *
211 * Currently, this will never shrink a buffer, only expand it.
212 *
213 * If the allocation fails, this will return an error and the buffer will be
214 * marked as invalid for future operations, invaliding the contents.
215 *
216 * @param buffer The buffer to be resized; may or may not be allocated yet
217 * @param target_size The desired available size
218 * @return 0 on success, -1 on allocation failure
219 */
220GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size);
221
222/**
223 * Set buffer to a copy of some raw data.
224 *
225 * @param buffer The buffer to set
226 * @param data The data to copy into the buffer
227 * @param datalen The length of the data to copy into the buffer
228 * @return 0 on success, -1 on allocation failure
229 */
230GIT_EXTERN(int) git_buf_set(
231 git_buf *buffer, const void *data, size_t datalen);
232
233/**
234* Check quickly if buffer looks like it contains binary data
235*
236* @param buf Buffer to check
237* @return 1 if buffer looks like non-text data
238*/
239GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf);
240
241/**
242* Check quickly if buffer contains a NUL byte
243*
244* @param buf Buffer to check
245* @return 1 if buffer contains a NUL byte
246*/
247GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf);
248
ac3d33df
JK
249/**
250 * Free the memory referred to by the git_buf. This is an alias of
251 * `git_buf_dispose` and is preserved for backward compatibility.
252 *
253 * This function is deprecated, but there is no plan to remove this
254 * function at this time.
255 *
256 * @deprecated Use git_buf_dispose
257 * @see git_buf_dispose
258 */
259GIT_EXTERN(void) git_buf_free(git_buf *buffer);
260
261/**@}*/
262
c25aa7cd
PP
263/** @name Deprecated Commit Definitions
264 */
265/**@{*/
266
267/**
268 * Provide a commit signature during commit creation.
269 *
270 * Callers should instead define a `git_commit_create_cb` that
271 * generates a commit buffer using `git_commit_create_buffer`, sign
272 * that buffer and call `git_commit_create_with_signature`.
273 *
274 * @deprecated use a `git_commit_create_cb` instead
275 */
276typedef int (*git_commit_signing_cb)(
277 git_buf *signature,
278 git_buf *signature_field,
279 const char *commit_content,
280 void *payload);
281
282/**@}*/
283
22a2d3d5
UG
284/** @name Deprecated Config Functions and Constants
285 */
286/**@{*/
287
288#define GIT_CVAR_FALSE GIT_CONFIGMAP_FALSE
289#define GIT_CVAR_TRUE GIT_CONFIGMAP_TRUE
290#define GIT_CVAR_INT32 GIT_CONFIGMAP_INT32
291#define GIT_CVAR_STRING GIT_CONFIGMAP_STRING
292
293typedef git_configmap git_cvar_map;
294
295/**@}*/
296
c25aa7cd
PP
297/** @name Deprecated Diff Functions and Constants
298 *
299 * These functions and enumeration values are retained for backward
300 * compatibility. The newer versions of these functions and values
301 * should be preferred in all new code.
302 *
303 * There is no plan to remove these backward compatibility values at
304 * this time.
305 */
306/**@{*/
307
308/**
309 * Formatting options for diff e-mail generation
310 */
311typedef enum {
312 /** Normal patch, the default */
313 GIT_DIFF_FORMAT_EMAIL_NONE = 0,
314
315 /** Don't insert "[PATCH]" in the subject header*/
e579e0f7 316 GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0)
c25aa7cd
PP
317
318} git_diff_format_email_flags_t;
319
320/**
321 * Options for controlling the formatting of the generated e-mail.
322 */
323typedef struct {
324 unsigned int version;
325
326 /** see `git_diff_format_email_flags_t` above */
327 uint32_t flags;
328
329 /** This patch number */
330 size_t patch_no;
331
332 /** Total number of patches in this series */
333 size_t total_patches;
334
335 /** id to use for the commit */
336 const git_oid *id;
337
338 /** Summary of the change */
339 const char *summary;
340
341 /** Commit message's body */
342 const char *body;
343
344 /** Author of the change */
345 const git_signature *author;
346} git_diff_format_email_options;
347
348#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
349#define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
350
351/**
352 * Create an e-mail ready patch from a diff.
353 *
354 * @deprecated git_email_create_from_diff
355 * @see git_email_create_from_diff
356 */
357GIT_EXTERN(int) git_diff_format_email(
358 git_buf *out,
359 git_diff *diff,
360 const git_diff_format_email_options *opts);
361
362/**
363 * Create an e-mail ready patch for a commit.
364 *
365 * @deprecated git_email_create_from_commit
366 * @see git_email_create_from_commit
367 */
368GIT_EXTERN(int) git_diff_commit_as_email(
369 git_buf *out,
370 git_repository *repo,
371 git_commit *commit,
372 size_t patch_no,
373 size_t total_patches,
374 uint32_t flags,
375 const git_diff_options *diff_opts);
376
377/**
378 * Initialize git_diff_format_email_options structure
379 *
380 * Initializes a `git_diff_format_email_options` with default values. Equivalent
381 * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
382 *
383 * @param opts The `git_blame_options` struct to initialize.
384 * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
385 * @return Zero on success; -1 on failure.
386 */
387GIT_EXTERN(int) git_diff_format_email_options_init(
388 git_diff_format_email_options *opts,
389 unsigned int version);
390
391/**@}*/
392
ac3d33df
JK
393/** @name Deprecated Error Functions and Constants
394 *
395 * These functions and enumeration values are retained for backward
396 * compatibility. The newer versions of these functions and values
397 * should be preferred in all new code.
398 *
399 * There is no plan to remove these backward compatibility values at
400 * this time.
401 */
402/**@{*/
403
404#define GITERR_NONE GIT_ERROR_NONE
405#define GITERR_NOMEMORY GIT_ERROR_NOMEMORY
406#define GITERR_OS GIT_ERROR_OS
407#define GITERR_INVALID GIT_ERROR_INVALID
408#define GITERR_REFERENCE GIT_ERROR_REFERENCE
409#define GITERR_ZLIB GIT_ERROR_ZLIB
410#define GITERR_REPOSITORY GIT_ERROR_REPOSITORY
411#define GITERR_CONFIG GIT_ERROR_CONFIG
412#define GITERR_REGEX GIT_ERROR_REGEX
413#define GITERR_ODB GIT_ERROR_ODB
414#define GITERR_INDEX GIT_ERROR_INDEX
415#define GITERR_OBJECT GIT_ERROR_OBJECT
416#define GITERR_NET GIT_ERROR_NET
417#define GITERR_TAG GIT_ERROR_TAG
418#define GITERR_TREE GIT_ERROR_TREE
419#define GITERR_INDEXER GIT_ERROR_INDEXER
420#define GITERR_SSL GIT_ERROR_SSL
421#define GITERR_SUBMODULE GIT_ERROR_SUBMODULE
422#define GITERR_THREAD GIT_ERROR_THREAD
423#define GITERR_STASH GIT_ERROR_STASH
424#define GITERR_CHECKOUT GIT_ERROR_CHECKOUT
425#define GITERR_FETCHHEAD GIT_ERROR_FETCHHEAD
426#define GITERR_MERGE GIT_ERROR_MERGE
427#define GITERR_SSH GIT_ERROR_SSH
428#define GITERR_FILTER GIT_ERROR_FILTER
429#define GITERR_REVERT GIT_ERROR_REVERT
430#define GITERR_CALLBACK GIT_ERROR_CALLBACK
431#define GITERR_CHERRYPICK GIT_ERROR_CHERRYPICK
432#define GITERR_DESCRIBE GIT_ERROR_DESCRIBE
433#define GITERR_REBASE GIT_ERROR_REBASE
434#define GITERR_FILESYSTEM GIT_ERROR_FILESYSTEM
435#define GITERR_PATCH GIT_ERROR_PATCH
436#define GITERR_WORKTREE GIT_ERROR_WORKTREE
437#define GITERR_SHA1 GIT_ERROR_SHA1
438
ad5611d8
TR
439#define GIT_ERROR_SHA1 GIT_ERROR_SHA
440
ac3d33df
JK
441/**
442 * Return the last `git_error` object that was generated for the
443 * current thread. This is an alias of `git_error_last` and is
444 * preserved for backward compatibility.
445 *
446 * This function is deprecated, but there is no plan to remove this
447 * function at this time.
448 *
449 * @deprecated Use git_error_last
450 * @see git_error_last
451 */
452GIT_EXTERN(const git_error *) giterr_last(void);
453
454/**
455 * Clear the last error. This is an alias of `git_error_last` and is
456 * preserved for backward compatibility.
457 *
458 * This function is deprecated, but there is no plan to remove this
459 * function at this time.
460 *
461 * @deprecated Use git_error_clear
462 * @see git_error_clear
463 */
464GIT_EXTERN(void) giterr_clear(void);
465
466/**
467 * Sets the error message to the given string. This is an alias of
468 * `git_error_set_str` and is preserved for backward compatibility.
469 *
470 * This function is deprecated, but there is no plan to remove this
471 * function at this time.
472 *
473 * @deprecated Use git_error_set_str
474 * @see git_error_set_str
475 */
476GIT_EXTERN(void) giterr_set_str(int error_class, const char *string);
477
478/**
22a2d3d5 479 * Indicates that an out-of-memory situation occurred. This is an alias
ac3d33df
JK
480 * of `git_error_set_oom` and is preserved for backward compatibility.
481 *
482 * This function is deprecated, but there is no plan to remove this
483 * function at this time.
484 *
485 * @deprecated Use git_error_set_oom
486 * @see git_error_set_oom
487 */
488GIT_EXTERN(void) giterr_set_oom(void);
489
490/**@}*/
491
22a2d3d5 492/** @name Deprecated Index Functions and Constants
ac3d33df 493 *
22a2d3d5
UG
494 * These functions and enumeration values are retained for backward
495 * compatibility. The newer versions of these values should be
496 * preferred in all new code.
ac3d33df
JK
497 *
498 * There is no plan to remove these backward compatibility values at
499 * this time.
500 */
501/**@{*/
502
503#define GIT_IDXENTRY_NAMEMASK GIT_INDEX_ENTRY_NAMEMASK
504#define GIT_IDXENTRY_STAGEMASK GIT_INDEX_ENTRY_STAGEMASK
505#define GIT_IDXENTRY_STAGESHIFT GIT_INDEX_ENTRY_STAGESHIFT
506
507/* The git_indxentry_flag_t enum */
508#define GIT_IDXENTRY_EXTENDED GIT_INDEX_ENTRY_EXTENDED
509#define GIT_IDXENTRY_VALID GIT_INDEX_ENTRY_VALID
510
511#define GIT_IDXENTRY_STAGE(E) GIT_INDEX_ENTRY_STAGE(E)
512#define GIT_IDXENTRY_STAGE_SET(E,S) GIT_INDEX_ENTRY_STAGE_SET(E,S)
513
514/* The git_idxentry_extended_flag_t enum */
515#define GIT_IDXENTRY_INTENT_TO_ADD GIT_INDEX_ENTRY_INTENT_TO_ADD
516#define GIT_IDXENTRY_SKIP_WORKTREE GIT_INDEX_ENTRY_SKIP_WORKTREE
517#define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_INDEX_ENTRY_INTENT_TO_ADD | GIT_INDEX_ENTRY_SKIP_WORKTREE)
518#define GIT_IDXENTRY_EXTENDED2 (1 << 15)
519#define GIT_IDXENTRY_UPDATE (1 << 0)
520#define GIT_IDXENTRY_REMOVE (1 << 1)
521#define GIT_IDXENTRY_UPTODATE (1 << 2)
522#define GIT_IDXENTRY_ADDED (1 << 3)
523#define GIT_IDXENTRY_HASHED (1 << 4)
524#define GIT_IDXENTRY_UNHASHED (1 << 5)
525#define GIT_IDXENTRY_WT_REMOVE (1 << 6)
526#define GIT_IDXENTRY_CONFLICTED (1 << 7)
527#define GIT_IDXENTRY_UNPACKED (1 << 8)
528#define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
529
530/* The git_index_capability_t enum */
531#define GIT_INDEXCAP_IGNORE_CASE GIT_INDEX_CAPABILITY_IGNORE_CASE
532#define GIT_INDEXCAP_NO_FILEMODE GIT_INDEX_CAPABILITY_NO_FILEMODE
533#define GIT_INDEXCAP_NO_SYMLINKS GIT_INDEX_CAPABILITY_NO_SYMLINKS
534#define GIT_INDEXCAP_FROM_OWNER GIT_INDEX_CAPABILITY_FROM_OWNER
535
22a2d3d5
UG
536GIT_EXTERN(int) git_index_add_frombuffer(
537 git_index *index,
538 const git_index_entry *entry,
539 const void *buffer, size_t len);
540
ac3d33df
JK
541/**@}*/
542
543/** @name Deprecated Object Constants
544 *
545 * These enumeration values are retained for backward compatibility. The
546 * newer versions of these values should be preferred in all new code.
547 *
548 * There is no plan to remove these backward compatibility values at
549 * this time.
550 */
551/**@{*/
552
553#define git_otype git_object_t
554
555#define GIT_OBJ_ANY GIT_OBJECT_ANY
556#define GIT_OBJ_BAD GIT_OBJECT_INVALID
557#define GIT_OBJ__EXT1 0
558#define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
559#define GIT_OBJ_TREE GIT_OBJECT_TREE
560#define GIT_OBJ_BLOB GIT_OBJECT_BLOB
561#define GIT_OBJ_TAG GIT_OBJECT_TAG
562#define GIT_OBJ__EXT2 5
563#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
564#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
565
22a2d3d5
UG
566/**
567 * Get the size in bytes for the structure which
568 * acts as an in-memory representation of any given
569 * object type.
570 *
571 * For all the core types, this would the equivalent
572 * of calling `sizeof(git_commit)` if the core types
573 * were not opaque on the external API.
574 *
575 * @param type object type to get its size
576 * @return size in bytes of the object
577 */
578GIT_EXTERN(size_t) git_object__size(git_object_t type);
579
ac3d33df
JK
580/**@}*/
581
c25aa7cd 582/** @name Deprecated Remote Functions
ac3d33df 583 *
c25aa7cd
PP
584 * These functions are retained for backward compatibility. The newer
585 * versions of these functions should be preferred in all new code.
586 *
587 * There is no plan to remove these backward compatibility functions at
588 * this time.
589 */
590/**@{*/
591
592/**
593 * Ensure the remote name is well-formed.
594 *
595 * @deprecated Use git_remote_name_is_valid
596 * @param remote_name name to be checked.
597 * @return 1 if the reference name is acceptable; 0 if it isn't
598 */
599GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
600
601/**@}*/
602
603/** @name Deprecated Reference Functions and Constants
604 *
605 * These functions and enumeration values are retained for backward
606 * compatibility. The newer versions of these values should be
607 * preferred in all new code.
ac3d33df
JK
608 *
609 * There is no plan to remove these backward compatibility values at
610 * this time.
611 */
612/**@{*/
613
614 /** Basic type of any Git reference. */
615#define git_ref_t git_reference_t
616#define git_reference_normalize_t git_reference_format_t
617
618#define GIT_REF_INVALID GIT_REFERENCE_INVALID
619#define GIT_REF_OID GIT_REFERENCE_DIRECT
620#define GIT_REF_SYMBOLIC GIT_REFERENCE_SYMBOLIC
621#define GIT_REF_LISTALL GIT_REFERENCE_ALL
622
623#define GIT_REF_FORMAT_NORMAL GIT_REFERENCE_FORMAT_NORMAL
624#define GIT_REF_FORMAT_ALLOW_ONELEVEL GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL
625#define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
626#define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
627
c25aa7cd
PP
628/**
629 * Ensure the reference name is well-formed.
630 *
631 * Valid reference names must follow one of two patterns:
632 *
633 * 1. Top-level names must contain only capital letters and underscores,
634 * and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
635 * 2. Names prefixed with "refs/" can be almost anything. You must avoid
636 * the characters '~', '^', ':', '\\', '?', '[', and '*', and the
637 * sequences ".." and "@{" which have special meaning to revparse.
638 *
639 * @deprecated Use git_reference_name_is_valid
640 * @param refname name to be checked.
641 * @return 1 if the reference name is acceptable; 0 if it isn't
642 */
643GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
644
22a2d3d5
UG
645GIT_EXTERN(int) git_tag_create_frombuffer(
646 git_oid *oid,
647 git_repository *repo,
648 const char *buffer,
649 int force);
650
651/**@}*/
652
c25aa7cd
PP
653/** @name Deprecated Revspec Constants
654 *
655 * These enumeration values are retained for backward compatibility.
656 * The newer versions of these values should be preferred in all new
657 * code.
658 *
659 * There is no plan to remove these backward compatibility values at
660 * this time.
661 */
662/**@{*/
663
664typedef git_revspec_t git_revparse_mode_t;
665
666#define GIT_REVPARSE_SINGLE GIT_REVSPEC_SINGLE
667#define GIT_REVPARSE_RANGE GIT_REVSPEC_RANGE
668#define GIT_REVPARSE_MERGE_BASE GIT_REVSPEC_MERGE_BASE
669
670/**@}*/
671
22a2d3d5
UG
672/** @name Deprecated Credential Types
673 *
674 * These types are retained for backward compatibility. The newer
675 * versions of these values should be preferred in all new code.
676 *
677 * There is no plan to remove these backward compatibility values at
678 * this time.
679 */
c25aa7cd 680/**@{*/
22a2d3d5
UG
681
682typedef git_credential git_cred;
683typedef git_credential_userpass_plaintext git_cred_userpass_plaintext;
684typedef git_credential_username git_cred_username;
685typedef git_credential_default git_cred_default;
686typedef git_credential_ssh_key git_cred_ssh_key;
687typedef git_credential_ssh_interactive git_cred_ssh_interactive;
688typedef git_credential_ssh_custom git_cred_ssh_custom;
689
690typedef git_credential_acquire_cb git_cred_acquire_cb;
691typedef git_credential_sign_cb git_cred_sign_callback;
692typedef git_credential_sign_cb git_cred_sign_cb;
693typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_callback;
694typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_cb;
695
696#define git_credtype_t git_credential_t
697
698#define GIT_CREDTYPE_USERPASS_PLAINTEXT GIT_CREDENTIAL_USERPASS_PLAINTEXT
699#define GIT_CREDTYPE_SSH_KEY GIT_CREDENTIAL_SSH_KEY
700#define GIT_CREDTYPE_SSH_CUSTOM GIT_CREDENTIAL_SSH_CUSTOM
701#define GIT_CREDTYPE_DEFAULT GIT_CREDENTIAL_DEFAULT
702#define GIT_CREDTYPE_SSH_INTERACTIVE GIT_CREDENTIAL_SSH_INTERACTIVE
703#define GIT_CREDTYPE_USERNAME GIT_CREDENTIAL_USERNAME
704#define GIT_CREDTYPE_SSH_MEMORY GIT_CREDENTIAL_SSH_MEMORY
705
706GIT_EXTERN(void) git_cred_free(git_credential *cred);
707GIT_EXTERN(int) git_cred_has_username(git_credential *cred);
708GIT_EXTERN(const char *) git_cred_get_username(git_credential *cred);
709GIT_EXTERN(int) git_cred_userpass_plaintext_new(
710 git_credential **out,
711 const char *username,
712 const char *password);
713GIT_EXTERN(int) git_cred_default_new(git_credential **out);
714GIT_EXTERN(int) git_cred_username_new(git_credential **out, const char *username);
715GIT_EXTERN(int) git_cred_ssh_key_new(
716 git_credential **out,
717 const char *username,
718 const char *publickey,
719 const char *privatekey,
720 const char *passphrase);
721GIT_EXTERN(int) git_cred_ssh_key_memory_new(
722 git_credential **out,
723 const char *username,
724 const char *publickey,
725 const char *privatekey,
726 const char *passphrase);
727GIT_EXTERN(int) git_cred_ssh_interactive_new(
728 git_credential **out,
729 const char *username,
730 git_credential_ssh_interactive_cb prompt_callback,
731 void *payload);
732GIT_EXTERN(int) git_cred_ssh_key_from_agent(
733 git_credential **out,
734 const char *username);
735GIT_EXTERN(int) git_cred_ssh_custom_new(
736 git_credential **out,
737 const char *username,
738 const char *publickey,
739 size_t publickey_len,
740 git_credential_sign_cb sign_callback,
741 void *payload);
742
743/* Deprecated Credential Helper Types */
744
745typedef git_credential_userpass_payload git_cred_userpass_payload;
746
747GIT_EXTERN(int) git_cred_userpass(
748 git_credential **out,
749 const char *url,
750 const char *user_from_url,
751 unsigned int allowed_types,
752 void *payload);
753
754/**@}*/
755
756/** @name Deprecated Trace Callback Types
757 *
758 * These types are retained for backward compatibility. The newer
759 * versions of these values should be preferred in all new code.
760 *
761 * There is no plan to remove these backward compatibility values at
762 * this time.
763 */
764/**@{*/
765
766typedef git_trace_cb git_trace_callback;
767
768/**@}*/
769
770/** @name Deprecated Object ID Types
771 *
772 * These types are retained for backward compatibility. The newer
773 * versions of these values should be preferred in all new code.
774 *
775 * There is no plan to remove these backward compatibility values at
776 * this time.
777 */
778/**@{*/
779
780GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
781
782/**@}*/
783
c25aa7cd
PP
784/** @name Deprecated OID Array Functions
785 *
786 * These types are retained for backward compatibility. The newer
787 * versions of these values should be preferred in all new code.
788 *
789 * There is no plan to remove these backward compatibility values at
790 * this time.
791 */
792/**@{*/
793
794/**
795 * Free the memory referred to by the git_oidarray. This is an alias of
796 * `git_oidarray_dispose` and is preserved for backward compatibility.
797 *
798 * This function is deprecated, but there is no plan to remove this
799 * function at this time.
800 *
801 * @deprecated Use git_oidarray_dispose
802 * @see git_oidarray_dispose
803 */
804GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
805
806/**@}*/
807
22a2d3d5
UG
808/** @name Deprecated Transfer Progress Types
809 *
810 * These types are retained for backward compatibility. The newer
811 * versions of these values should be preferred in all new code.
812 *
813 * There is no plan to remove these backward compatibility values at
814 * this time.
815 */
816/**@{*/
817
818/**
819 * This structure is used to provide callers information about the
820 * progress of indexing a packfile.
821 *
822 * This type is deprecated, but there is no plan to remove this
823 * type definition at this time.
824 */
825typedef git_indexer_progress git_transfer_progress;
826
827/**
828 * Type definition for progress callbacks during indexing.
829 *
830 * This type is deprecated, but there is no plan to remove this
831 * type definition at this time.
832 */
833typedef git_indexer_progress_cb git_transfer_progress_cb;
834
835/**
836 * Type definition for push transfer progress callbacks.
837 *
838 * This type is deprecated, but there is no plan to remove this
839 * type definition at this time.
840 */
841typedef git_push_transfer_progress_cb git_push_transfer_progress;
842
843 /** The type of a remote completion event */
844#define git_remote_completion_type git_remote_completion_t
845
846/**
847 * Callback for listing the remote heads
848 */
849typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload);
850
851/**@}*/
852
853/** @name Deprecated String Array Functions
854 *
855 * These types are retained for backward compatibility. The newer
856 * versions of these values should be preferred in all new code.
857 *
858 * There is no plan to remove these backward compatibility values at
859 * this time.
860 */
861/**@{*/
862
863/**
864 * Copy a string array object from source to target.
865 *
866 * This function is deprecated, but there is no plan to remove this
867 * function at this time.
868 *
869 * @param tgt target
870 * @param src source
871 * @return 0 on success, < 0 on allocation failure
872 */
873GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
874
875/**
876 * Free the memory referred to by the git_strarray. This is an alias of
877 * `git_strarray_dispose` and is preserved for backward compatibility.
878 *
879 * This function is deprecated, but there is no plan to remove this
880 * function at this time.
881 *
882 * @deprecated Use git_strarray_dispose
883 * @see git_strarray_dispose
884 */
885GIT_EXTERN(void) git_strarray_free(git_strarray *array);
886
887/**@}*/
888
889/** @name Deprecated Options Initialization Functions
890 *
891 * These functions are retained for backward compatibility. The newer
892 * versions of these functions should be preferred in all new code.
893 *
894 * There is no plan to remove these backward compatibility functions at
895 * this time.
896 */
897/**@{*/
898
899GIT_EXTERN(int) git_blame_init_options(git_blame_options *opts, unsigned int version);
900GIT_EXTERN(int) git_checkout_init_options(git_checkout_options *opts, unsigned int version);
901GIT_EXTERN(int) git_cherrypick_init_options(git_cherrypick_options *opts, unsigned int version);
902GIT_EXTERN(int) git_clone_init_options(git_clone_options *opts, unsigned int version);
903GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
904GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
905GIT_EXTERN(int) git_diff_init_options(git_diff_options *opts, unsigned int version);
906GIT_EXTERN(int) git_diff_find_init_options(git_diff_find_options *opts, unsigned int version);
907GIT_EXTERN(int) git_diff_format_email_init_options(git_diff_format_email_options *opts, unsigned int version);
908GIT_EXTERN(int) git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version);
909GIT_EXTERN(int) git_fetch_init_options(git_fetch_options *opts, unsigned int version);
910GIT_EXTERN(int) git_indexer_init_options(git_indexer_options *opts, unsigned int version);
911GIT_EXTERN(int) git_merge_init_options(git_merge_options *opts, unsigned int version);
912GIT_EXTERN(int) git_merge_file_init_input(git_merge_file_input *input, unsigned int version);
913GIT_EXTERN(int) git_merge_file_init_options(git_merge_file_options *opts, unsigned int version);
914GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
915GIT_EXTERN(int) git_push_init_options(git_push_options *opts, unsigned int version);
916GIT_EXTERN(int) git_rebase_init_options(git_rebase_options *opts, unsigned int version);
917GIT_EXTERN(int) git_remote_create_init_options(git_remote_create_options *opts, unsigned int version);
918GIT_EXTERN(int) git_repository_init_init_options(git_repository_init_options *opts, unsigned int version);
919GIT_EXTERN(int) git_revert_init_options(git_revert_options *opts, unsigned int version);
920GIT_EXTERN(int) git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int version);
921GIT_EXTERN(int) git_status_init_options(git_status_options *opts, unsigned int version);
922GIT_EXTERN(int) git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version);
923GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts, unsigned int version);
924GIT_EXTERN(int) git_worktree_prune_init_options(git_worktree_prune_options *opts, unsigned int version);
925
ac3d33df
JK
926/**@}*/
927
928/** @} */
929GIT_END_DECL
930
931#endif
932
933#endif