- 14 Jan, 2019 1 commit
-
-
Duy Nguyen authored
Signed-off-by:
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 29 Jun, 2018 1 commit
-
-
Stefan Beller authored
Add a repository argument to allow callers of lookup_commit to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by:
Stefan Beller <sbeller@google.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 30 Jan, 2018 2 commits
-
-
Patryk Obara authored
Convert the definition and declaration of write_notes_tree to struct object_id and adjust usage of this function. Additionally, improve style of small part of this function, as old formatting made it hard to understand at glance what this part of code is doing. Signed-off-by:
Patryk Obara <patryk.obara@gmail.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
Patryk Obara authored
Convert the definitions and declarations of commit_tree and commit_tree_extended to use struct object_id and adjust all usages of these functions. Signed-off-by:
Patryk Obara <patryk.obara@gmail.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 16 Oct, 2017 2 commits
-
-
brian m. carlson authored
All but two of the call sites already have parameters using the hash parameter of struct object_id, so convert them to take a pointer to the struct directly. Also convert refs_read_refs_full, the underlying implementation. Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
brian m. carlson authored
Convert update_ref, refs_update_ref, and write_pseudoref to use struct object_id. Update the existing callers as well. Remove update_ref_oid, as it is no longer needed. Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 15 Jun, 2017 1 commit
-
-
Brandon Williams authored
Stop including config.h by default in cache.h. Instead only include config.h in those files which require use of the config system. Signed-off-by:
Brandon Williams <bmwill@google.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 02 Jun, 2017 2 commits
-
-
brian m. carlson authored
Convert add_note, get_note, and copy_note to take struct object_id. Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Brandon Williams <bmwill@google.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
brian m. carlson authored
Convert most of the static functions to use struct object_id. In addition, convert copy_notes_for_rewrite and its callers. Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Brandon Williams <bmwill@google.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 30 May, 2017 1 commit
-
-
Ævar Arnfjörð Bjarmason authored
Change all the "TRANSLATORS: [...]" comments in the C code to use the regular Git coding style, and amend the style guide so that the example there uses that style. This custom style was necessary back in 2010 when the gettext support was initially added, and was subsequently documented in commit cbcfd4e3 ("i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines", 2014-04-18). GNU xgettext hasn't had the parsing limitation that necessitated this exception for almost 3 years. Since its 0.19 release on 2014-06-02 it's been able to recognize TRANSLATOR comments in the standard Git comment syntax[1]. Usually we'd like to keep compatibility with software that's that young, but in this case literally the only person who needs to be using a gettext newer than 3 years old is Jiang Xin (the only person who runs & commits "make pot" results), so I think in this case we can make an exception. This xgettext parsing feature was added after a thread on the Git mailing list[2] which continued on the bug-gettext[3] list, but we never subsequently changed our style & styleguide, do so. There are already longstanding changes in git that use the standard comment style & have their TRANSLATORS comments extracted properly without getting the literal "*"'s mixed up in the text, as would happen before xgettext 0.19. Commit 7ff26832 ("builtin-am: implement -i/--interactive", 2015-08-04) added one such comment, which in commit df0617bf ("l10n: git.pot: v2.6.0 round 1 (123 new, 41 removed)", 2015-09-05) got picked up in the po/git.pot file with the right format, showing that Jiang already runs a modern xgettext. The xgettext parser does not handle the sort of non-standard comment style that I'm amending here in sequencer.c, but that isn't standard Git comment syntax anyway. With this change to sequencer.c & "make pot" the comment in the pot file is now correct: #. TRANSLATORS: %s will be "revert", "cherry-pick" or -#. * "rebase -i". +#. "rebase -i". 1. http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=10af7fe6bd 2. <2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com> (https://public-inbox.org/git/2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com/) 3. https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00016.htmlSigned-off-by:
Ævar Arnfjörð Bjarmason <avarab@gmail.com> Acked-by:
Jiang Xin <worldhello.net@gmail.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 08 May, 2017 2 commits
-
-
brian m. carlson authored
Convert lookup_commit, lookup_commit_or_die, lookup_commit_reference, and lookup_commit_reference_gently to take struct object_id arguments. Introduce a temporary in parse_object buffer in order to convert this function. This is required since in order to convert parse_object and parse_object_buffer, lookup_commit_reference_gently and lookup_commit_or_die would need to be converted. Not introducing a temporary would therefore require that lookup_commit_or_die take a struct object_id *, but lookup_commit would take unsigned char *, leaving a confusing and hard-to-use interface. parse_object_buffer will lose this temporary in a later patch. This commit was created with manual changes to commit.c, commit.h, and object.c, plus the following semantic patch: @@ expression E1, E2; @@ - lookup_commit_reference_gently(E1.hash, E2) + lookup_commit_reference_gently(&E1, E2) @@ expression E1, E2; @@ - lookup_commit_reference_gently(E1->hash, E2) + lookup_commit_reference_gently(E1, E2) @@ expression E1; @@ - lookup_commit_reference(E1.hash) + lookup_commit_reference(&E1) @@ expression E1; @@ - lookup_commit_reference(E1->hash) + lookup_commit_reference(E1) @@ expression E1; @@ - lookup_commit(E1.hash) + lookup_commit(&E1) @@ expression E1; @@ - lookup_commit(E1->hash) + lookup_commit(E1) @@ expression E1, E2; @@ - lookup_commit_or_die(E1.hash, E2) + lookup_commit_or_die(&E1, E2) @@ expression E1, E2; @@ - lookup_commit_or_die(E1->hash, E2) + lookup_commit_or_die(E1, E2) Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
brian m. carlson authored
Convert the internals of create_notes_comit and commit_notes to use struct object_id. Signed-off-by:
brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 12 Jan, 2016 1 commit
-
-
Mike Hommey authored
init_notes() is the main point of entry to the notes API. It ensures that the input can be used as ref, because it needs a ref to update to store notes tree after modifying it. There however are many use cases where notes tree is only read, e.g. "git log --notes=...". Any notes-shaped treeish could be used for such purpose, but it is not allowed due to existing restriction. Allow treeish expressions to be used in the case the notes tree is going to be used without write "permissions". Add a flag to distinguish whether the notes tree is intended to be used read-only, or will be updated. With this change, operations that use notes read-only can be fed any notes-shaped tree-ish can be used, e.g. git log --notes=notes@{1}. Signed-off-by:
Mike Hommey <mh@glandium.org> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 17 Aug, 2015 1 commit
-
-
Jacob Keller authored
Signed-off-by:
Jacob Keller <jacob.keller@gmail.com> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 12 Dec, 2014 1 commit
-
-
René Scharfe authored
Call strbuf_complete_line() instead of open-coding it. Also remove surrounding comments indicating the intent to complete a line since this information is already included in the function name. Signed-off-by:
Rene Scharfe <l.s.r@web.de> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 12 Jun, 2014 1 commit
-
-
Jeff King authored
While strbufs are pretty common throughout our code, it is more flexible for functions to take a pointer/len pair than a strbuf. It's easy to turn a strbuf into such a pair (by dereferencing its members), but less easy to go the other way (you can strbuf_attach, but that has implications about memory ownership). This patch teaches commit_tree (and its associated callers and sub-functions) to take such a pair for the commit message rather than a strbuf. This makes passing the buffer around slightly more verbose, but means we can get rid of some dangerous strbuf_attach calls in the next patch. Signed-off-by:
Jeff King <peff@peff.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 07 Apr, 2014 1 commit
-
-
Michael Haggerty authored
Given that these constants are only being used when updating references, it is inappropriate to give them such generic names as "DIE_ON_ERR". So prefix their names with "UPDATE_REFS_". Signed-off-by:
Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 18 Feb, 2014 1 commit
-
-
John Keeping authored
If we carry on after outputting config_error_nonbool then we're guaranteed to dereference a null pointer. Signed-off-by:
John Keeping <john@keeping.me.uk> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 05 Dec, 2013 1 commit
-
-
Christian Couder authored
Leaving only the function definitions and declarations so that any new topic in flight can still make use of the old functions, replace existing uses of the prefixcmp() and suffixcmp() with new API functions. The change can be recreated by mechanically applying this: $ git grep -l -e prefixcmp -e suffixcmp -- \*.c | grep -v strbuf\\.c | xargs perl -pi -e ' s|!prefixcmp\(|starts_with\(|g; s|prefixcmp\(|!starts_with\(|g; s|!suffixcmp\(|ends_with\(|g; s|suffixcmp\(|!ends_with\(|g; ' on the result of preparatory changes in this series. Signed-off-by:
Christian Couder <chriscool@tuxfamily.org> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 24 Oct, 2013 1 commit
-
-
Jeff King authored
The parse_commit function will check whether it was passed a NULL commit pointer, and if so, return an error. There is no need for callers to check this separately. Signed-off-by:
Jeff King <peff@peff.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
- 12 Jun, 2013 2 commits
-
-
Johan Herland authored
create_notes_commit() is needed by both the notes-merge code, and by commit_notes() in notes-utils. Since it is generally useful, and not bound to the notes-merge machinery, we move it from (the more specific) notes-merge to (the more general) notes-utils. Signed-off-by:
Johan Herland <johan@herland.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-
Johan Herland authored
This is a pure code movement of the machinery for copying notes to rewritten objects. This code was located in builtin/notes.c for historical reasons. In order to make it available to builtin/commit.c it was declared in builtin.h. This was more of an accident of history than a concious design, and we now want to make this machinery more widely available. Hence, this patch moves the code into the new notes-utils.[hc] files which are included into libgit.a. Except for adjusting #includes accordingly, this patch merely moves the relevant functions verbatim into the new files. Cc: Thomas Rast <trast@inf.ethz.ch> Signed-off-by:
Johan Herland <johan@herland.net> Signed-off-by:
Junio C Hamano <gitster@pobox.com>
-