Git development
 help / color / mirror / Atom feed
* Re: [PATCH v2 01/10] trailer: prepare to expose functions as part of API
From: Linus Arver @ 2024-01-30  2:43 UTC (permalink / raw)
  To: Josh Steadmon, Linus Arver via GitGitGadget
  Cc: git, Christian Couder, Junio C Hamano, Emily Shaffer,
	Randall S. Becker
In-Reply-To: <ZbhGUYcxEaeOXPAi@google.com>

Josh Steadmon <steadmon@google.com> writes:

> On 2024.01.26 22:38, Linus Arver via GitGitGadget wrote:
>> From: Linus Arver <linusa@google.com>
>> 
>> In the next patch, we will move "process_trailers" from trailer.c to
>> builtin/interpret-trailers.c. That move will necessitate the growth of
>> the trailer.h API, forcing us to expose some additional functions in
>> trailer.h.
>> 
>> Rename relevant functions so that they include the term "trailer" in
>> their name, so that clients of the API will be able to easily identify
>> them by their "trailer" moniker, just like all the other functions
>> already exposed by trailer.h.
>> 
>> The the opportunity to start putting trailer processions options (opts)
>
> Nitpick: typo in the commit message.
> s/The the opportunity/Take the opportunity/ ?

Ack, will update in reroll.

^ permalink raw reply

* “ Hello World “
From: ross nicholas Oneil thomas @ 2024-01-30  1:52 UTC (permalink / raw)
  To: GitHub, Github email, Legal Notice, licensing@mozilla.org,
	wikimedia-l-owner@lists.wikimedia.org, Microsoft Outlook,
	opencode@microsoft.com

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

Hello 
These guys do not own GitHub or any licenses to GitHub at least not to the JSON license! This is effecting me at coinbase! 




Ross Nicholas Oneil Thomas
ownership of:
www.github.com
www.coinbase.com
www.jsnull.com
(559-816-2950)


[-- Attachment #2: ewok.h --]
[-- Type: application/octet-stream, Size: 6898 bytes --]

/**
 * Copyright 2013, GitHub, Inc
 * Copyright 2009-2013, Daniel Lemire, Cliff Moon,
 *	David McIntosh, Robert Becho, Google Inc. and Veronika Zenz
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
#ifndef __EWOK_BITMAP_H__
#define __EWOK_BITMAP_H__

struct strbuf;
typedef uint64_t eword_t;
#define BITS_IN_EWORD (sizeof(eword_t) * 8)

/**
 * Do not use __builtin_popcountll. The GCC implementation
 * is notoriously slow on all platforms.
 *
 * See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36041
 */
static inline uint32_t ewah_bit_popcount64(uint64_t x)
{
	x = (x & 0x5555555555555555ULL) + ((x >>  1) & 0x5555555555555555ULL);
	x = (x & 0x3333333333333333ULL) + ((x >>  2) & 0x3333333333333333ULL);
	x = (x & 0x0F0F0F0F0F0F0F0FULL) + ((x >>  4) & 0x0F0F0F0F0F0F0F0FULL);
	return (x * 0x0101010101010101ULL) >> 56;
}

/* __builtin_ctzll was not available until 3.4.0 */
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3  && __GNUC_MINOR > 3))
#define ewah_bit_ctz64(x) __builtin_ctzll(x)
#else
static inline int ewah_bit_ctz64(uint64_t x)
{
	int n = 0;
	if ((x & 0xffffffff) == 0) { x >>= 32; n += 32; }
	if ((x &     0xffff) == 0) { x >>= 16; n += 16; }
	if ((x &       0xff) == 0) { x >>=  8; n +=  8; }
	if ((x &        0xf) == 0) { x >>=  4; n +=  4; }
	if ((x &        0x3) == 0) { x >>=  2; n +=  2; }
	if ((x &        0x1) == 0) { x >>=  1; n +=  1; }
	return n + !x;
}
#endif

struct ewah_bitmap {
	eword_t *buffer;
	size_t buffer_size;
	size_t alloc_size;
	size_t bit_size;
	eword_t *rlw;
};

typedef void (*ewah_callback)(size_t pos, void *);

struct ewah_bitmap *ewah_pool_new(void);
void ewah_pool_free(struct ewah_bitmap *self);

/**
 * Allocate a new EWAH Compressed bitmap
 */
struct ewah_bitmap *ewah_new(void);

/**
 * Clear all the bits in the bitmap. Does not free or resize
 * memory.
 */
void ewah_clear(struct ewah_bitmap *self);

/**
 * Free all the memory of the bitmap
 */
void ewah_free(struct ewah_bitmap *self);

int ewah_serialize_to(struct ewah_bitmap *self,
		      int (*write_fun)(void *out, const void *buf, size_t len),
		      void *out);
int ewah_serialize(struct ewah_bitmap *self, int fd);
int ewah_serialize_native(struct ewah_bitmap *self, int fd);
int ewah_serialize_strbuf(struct ewah_bitmap *self, struct strbuf *);

int ewah_deserialize(struct ewah_bitmap *self, int fd);
int ewah_read_mmap(struct ewah_bitmap *self, const void *map, size_t len);

uint32_t ewah_checksum(struct ewah_bitmap *self);

/**
 * Logical not (bitwise negation) in-place on the bitmap
 *
 * This operation is linear time based on the size of the bitmap.
 */
void ewah_not(struct ewah_bitmap *self);

/**
 * Call the given callback with the position of every single bit
 * that has been set on the bitmap.
 *
 * This is an efficient operation that does not fully decompress
 * the bitmap.
 */
void ewah_each_bit(struct ewah_bitmap *self, ewah_callback callback, void *payload);

/**
 * Set a given bit on the bitmap.
 *
 * The bit at position `pos` will be set to true. Because of the
 * way that the bitmap is compressed, a set bit cannot be unset
 * later on.
 *
 * Furthermore, since the bitmap uses streaming compression, bits
 * can only set incrementally.
 *
 * E.g.
 *		ewah_set(bitmap, 1); // ok
 *		ewah_set(bitmap, 76); // ok
 *		ewah_set(bitmap, 77); // ok
 *		ewah_set(bitmap, 8712800127); // ok
 *		ewah_set(bitmap, 25); // failed, assert raised
 */
void ewah_set(struct ewah_bitmap *self, size_t i);

struct ewah_iterator {
	const eword_t *buffer;
	size_t buffer_size;

	size_t pointer;
	eword_t compressed, literals;
	eword_t rl, lw;
	int b;
};

/**
 * Initialize a new iterator to run through the bitmap in uncompressed form.
 *
 * The iterator can be stack allocated. The underlying bitmap must not be freed
 * before the iteration is over.
 *
 * E.g.
 *
 *		struct ewah_bitmap *bitmap = ewah_new();
 *		struct ewah_iterator it;
 *
 *		ewah_iterator_init(&it, bitmap);
 */
void ewah_iterator_init(struct ewah_iterator *it, struct ewah_bitmap *parent);

/**
 * Yield every single word in the bitmap in uncompressed form. This is:
 * yield single words (32-64 bits) where each bit represents an actual
 * bit from the bitmap.
 *
 * Return: true if a word was yield, false if there are no words left
 */
int ewah_iterator_next(eword_t *next, struct ewah_iterator *it);

void ewah_or(
	struct ewah_bitmap *ewah_i,
	struct ewah_bitmap *ewah_j,
	struct ewah_bitmap *out);

void ewah_and_not(
	struct ewah_bitmap *ewah_i,
	struct ewah_bitmap *ewah_j,
	struct ewah_bitmap *out);

void ewah_xor(
	struct ewah_bitmap *ewah_i,
	struct ewah_bitmap *ewah_j,
	struct ewah_bitmap *out);

void ewah_and(
	struct ewah_bitmap *ewah_i,
	struct ewah_bitmap *ewah_j,
	struct ewah_bitmap *out);

/**
 * Direct word access
 */
size_t ewah_add_empty_words(struct ewah_bitmap *self, int v, size_t number);
void ewah_add_dirty_words(
	struct ewah_bitmap *self, const eword_t *buffer, size_t number, int negate);
size_t ewah_add(struct ewah_bitmap *self, eword_t word);


/**
 * Uncompressed, old-school bitmap that can be efficiently compressed
 * into an `ewah_bitmap`.
 */
struct bitmap {
	eword_t *words;
	size_t word_alloc;
};

struct bitmap *bitmap_new(void);
void bitmap_set(struct bitmap *self, size_t pos);
void bitmap_clear(struct bitmap *self, size_t pos);
int bitmap_get(struct bitmap *self, size_t pos);
void bitmap_reset(struct bitmap *self);
void bitmap_free(struct bitmap *self);
int bitmap_equals(struct bitmap *self, struct bitmap *other);
int bitmap_is_subset(struct bitmap *self, struct bitmap *super);

struct ewah_bitmap * bitmap_to_ewah(struct bitmap *bitmap);
struct bitmap *ewah_to_bitmap(struct ewah_bitmap *ewah);

void bitmap_and_not(struct bitmap *self, struct bitmap *other);
void bitmap_or_ewah(struct bitmap *self, struct ewah_bitmap *other);
void bitmap_or(struct bitmap *self, const struct bitmap *other);

void bitmap_each_bit(struct bitmap *self, ewah_callback callback, void *data);
size_t bitmap_popcount(struct bitmap *self);

#endif

[-- Attachment #3: ATT00001.txt --]
[-- Type: text/plain, Size: 115 bytes --]



Ross Nicholas Oneil Thomas
ownership of:
www.github.com
www.coinbase.com
www.jsnull.com
(559-816-2950)


^ permalink raw reply

* What's cooking in git.git (Jan 2024, #09; Mon, 29)
From: Junio C Hamano @ 2024-01-30  1:10 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking in my tree.  Commits
prefixed with '+' are in 'next' (being in 'next' is a sign that a
topic is stable enough to be used and are candidate to be in a
future release).  Commits prefixed with '-' are only in 'seen', and
aren't considered "accepted" at all and may be annotated with an URL
to a message that raises issues but they are no means exhaustive.  A
topic without enough support may be discarded after a long period of
no activity (of course they can be resubmit when new interests
arise).

Copies of the source code to Git live in many repositories, and the
following is a list of the ones I push into or their mirrors.  Some
repositories have only a subset of branches.

With maint, master, next, seen, todo:

	git://git.kernel.org/pub/scm/git/git.git/
	git://repo.or.cz/alt-git.git/
	https://kernel.googlesource.com/pub/scm/git/git/
	https://github.com/git/git/
	https://gitlab.com/git-vcs/git/

With all the integration branches and topics broken out:

	https://github.com/gitster/git/

Even though the preformatted documentation in HTML and man format
are not sources, they are published in these repositories for
convenience (replace "htmldocs" with "manpages" for the manual
pages):

	git://git.kernel.org/pub/scm/git/git-htmldocs.git/
	https://github.com/gitster/git-htmldocs.git/

Release tarballs are available at:

	https://www.kernel.org/pub/software/scm/git/

--------------------------------------------------
[Graduated to 'master']

* al/t2400-depipe (2024-01-20) 1 commit
  (merged to 'next' on 2024-01-22 at a20d4a9a7f)
 + t2400: avoid losing exit status to pipes

 Coding style fix.
 source: <20240120021547.199-1-ach.lumap@gmail.com>


* en/diffcore-delta-final-line-fix (2024-01-18) 1 commit
  (merged to 'next' on 2024-01-22 at 7141d202cb)
 + diffcore-delta: avoid ignoring final 'line' of file

 Rename detection logic ignored the final line of a file if it is an
 incomplete line.
 source: <pull.1637.v2.git.1705119973690.gitgitgadget@gmail.com>


* gt/t0024-style-fixes (2024-01-20) 2 commits
  (merged to 'next' on 2024-01-22 at 36b46efbd0)
 + t0024: style fix
 + t0024: avoid losing exit status to pipes

 Coding style fix.
 source: <20240118215407.8609-1-shyamthakkar001@gmail.com>


* jc/majordomo-to-subspace (2024-01-20) 1 commit
  (merged to 'next' on 2024-01-22 at 6a95f43de4)
 + Docs: majordomo@vger.kernel.org has been decomissioned

 Doc update.
 source: <xmqqmst1hsd6.fsf@gitster.g>


* js/oss-fuzz-build-in-ci (2024-01-19) 2 commits
  (merged to 'next' on 2024-01-22 at 2954da5a39)
 + ci: build and run minimal fuzzers in GitHub CI
 + fuzz: fix fuzz test build rules

 oss-fuzz tests are built and run in CI.
 source: <cover.1705700054.git.steadmon@google.com>


* nb/rebase-x-shell-docfix (2024-01-17) 1 commit
  (merged to 'next' on 2024-01-22 at db49e10354)
 + rebase: fix documentation about used shell in -x

 Doc update.
 source: <20240117085347.948960-1-nik.borisov@suse.com>


* ps/not-so-many-refs-are-special (2024-01-19) 7 commits
  (merged to 'next' on 2024-01-22 at f70f463847)
 + Documentation: add "special refs" to the glossary
 + refs: redefine special refs
 + refs: convert MERGE_AUTOSTASH to become a normal pseudo-ref
 + sequencer: introduce functions to handle autostashes via refs
 + refs: convert AUTO_MERGE to become a normal pseudo-ref
 + sequencer: delete REBASE_HEAD in correct repo when picking commits
 + sequencer: clean up pseudo refs with REF_NO_DEREF

 Define "special ref" as a very narrow set that consists of
 FETCH_HEAD and MERGE_HEAD, and clarify everything else that used to
 be classified as such are actually just pseudorefs.
 source: <cover.1705659748.git.ps@pks.im>


* ps/reftable-optimize-io (2024-01-18) 7 commits
  (merged to 'next' on 2024-01-22 at b867e8b9a8)
 + reftable/stack: fix race in up-to-date check
 + reftable/stack: unconditionally reload stack after commit
  (merged to 'next' on 2024-01-12 at 4096e880e0)
 + reftable/blocksource: use mmap to read tables
 + reftable/blocksource: refactor code to match our coding style
 + reftable/stack: use stat info to avoid re-reading stack list
 + reftable/stack: refactor reloading to use file descriptor
 + reftable/stack: refactor stack reloading to have common exit path

 Low-level I/O optimization for reftable.
 source: <cover.1704966670.git.ps@pks.im>
 source: <cover.1705585037.git.ps@pks.im>


* tc/show-ref-exists-fix (2024-01-18) 1 commit
  (merged to 'next' on 2024-01-22 at 831452f2dd)
 + builtin/show-ref: treat directory as non-existing in --exists

 Update to a new feature recently added, "git show-ref --exists".
 source: <20240110141559.387815-2-toon@iotcl.com>

--------------------------------------------------
[New Topics]

* jc/comment-style-fixes (2024-01-29) 3 commits
 - reftable/pq_test: comment style fix
 - merge-ort.c: comment style fix
 - builtin/worktree: comment style fixes

 Rewrite //-comments to /* comments */ in files whose comments
 prevalently use the latter.

 Will merge to 'next'.
 source: <20240129202839.2234084-1-gitster@pobox.com>


* jk/diff-external-with-no-index (2024-01-29) 1 commit
 - diff: handle NULL meta-info when spawning external diff

 "git diff --no-index file1 file2" segfaulted while invoking the
 external diff driver, which has been corrected.

 Will merge to 'next'.
 source: <20240129015708.GA1762343@coredump.intra.peff.net>


* jk/unit-tests-buildfix (2024-01-29) 2 commits
 - t/Makefile: get UNIT_TESTS list from C sources
 - Makefile: use order-only prereq for UNIT_TEST_BIN

 Build dependency fix around unit tests.

 Expecting a reroll.
 cf. <20240129202201.GA9612@szeder.dev>
 source: <20240129031540.GA2433764@coredump.intra.peff.net>


* js/merge-tree-3-trees (2024-01-29) 1 commit
 - merge-tree: accept 3 trees as arguments

 "git merge-tree" has learned that the three trees involved in the
 3-way merge only need to be trees, not necessarily commits.

 Will merge to 'next'.
 source: <pull.1647.v2.git.1706474063109.gitgitgadget@gmail.com>


* jt/p4-spell-re-with-raw-string (2024-01-29) 1 commit
 - git-p4: use raw string literals for regular expressions

 "git p4" update to squelch warnings from Python.

 Will merge to 'next'.
 source: <pull.1639.v2.git.1706312496608.gitgitgadget@gmail.com>


* kh/maintenance-use-xdg-when-it-should (2024-01-29) 1 commit
 - config: add back code comment

 Comment fix.

 Will merge to 'next'.
 source: <48d66e94ece3b763acbe933561d82157c02a5f58.1706466321.git.code@khaugsbakk.name>


* mh/credential-oauth-refresh-token-with-wincred (2024-01-29) 1 commit
 - credential/wincred: store oauth_refresh_token

 Teach wincred credential backend to support oauth refresh token the
 same way as credential-cache and credential-libsecret backends.

 Needs review.
 source: <pull.1534.v3.git.1706477103039.gitgitgadget@gmail.com>


* pb/complete-config (2024-01-29) 5 commits
 - completion: add an use _ _git_compute_second_level_config_vars_for_section
 - builtin/help: add --config-all-for-completion
 - completion: add and use _ _git_compute_first_level_config_vars_for_section
 - completion: complete 'submodule.*' config variables
 - completion: add space after config variable names also in Bash 3

 The command line completion script (in contrib/) learned to
 complete configuration variable names better.

 Needs review.
 source: <pull.1660.v2.git.git.1706534881.gitgitgadget@gmail.com>


* rj/complete-reflog (2024-01-26) 4 commits
 - completion: reflog show <log-options>
 - completion: reflog with implicit "show"
 - completion: introduce __git_find_subcommand
 - completion: introduce __gitcomp_subcommand

 The command line completion script (in contrib/) learned to
 complete "git reflog" better.

 Needs review.
 source: <98daf977-dbad-4d3b-a293-6a769895088f@gmail.com>


* rj/test-with-leak-check (2024-01-29) 4 commits
 - t0080: mark as leak-free
 - test-lib: check for TEST_PASSES_SANITIZE_LEAK
 - t6113: mark as leak-free
 - t5332: mark as leak-free

 Mark tests that are supposed to pass leak sanitizer as such.

 Will merge to 'next'?
 source: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>


* tb/pack-bitmap-drop-unused-struct-member (2024-01-29) 1 commit
 - pack-bitmap: drop unused `reuse_objects`

 Code clean-up.

 Will merge to 'next'.
 source: <0bbaf9a3591765161872fb71383263edb0c7ef83.1706328008.git.me@ttaylorr.com>

--------------------------------------------------
[Cooking]

* jc/coc-whitespace-fix (2024-01-23) 1 commit
  (merged to 'next' on 2024-01-26 at 6fb290ad59)
 + CoC: whitespace fix

 Docfix.

 Will merge to 'master'.
 source: <xmqqmssvnb8d.fsf_-_@gitster.g>


* jc/ls-files-doc-update (2024-01-25) 1 commit
  (merged to 'next' on 2024-01-26 at a71aeec3d3)
 + ls-files: avoid the verb "deprecate" for individual options

 The documentation for the --exclude-per-directory option marked it
 as deprecated, which confused readers into thinking there may be a
 plan to remove it in the future, which was not our intention.

 Will merge to 'master'.
 source: <xmqqjznybfp4.fsf@gitster.g>


* jk/fetch-auto-tag-following-fix (2024-01-24) 1 commit
  (merged to 'next' on 2024-01-26 at d058f1511b)
 + transport-helper: re-examine object dir after fetching

 Fetching via protocol v0 over Smart HTTP transport sometimes failed
 to correctly auto-follow tags.

 Will merge to 'master'.
 source: <20240124010056.GA2603087@coredump.intra.peff.net>


* ps/reftable-compacted-tables-permission-fix (2024-01-26) 1 commit
  (merged to 'next' on 2024-01-29 at dbb06e1571)
 + reftable/stack: adjust permissions of compacted tables

 Reftable bugfix.

 Will merge to 'master'.
 source: <a211818108053754aca002726d0206623a347952.1706263589.git.ps@pks.im>


* jc/index-pack-fsck-levels (2024-01-26) 2 commits
 - index-pack: --fsck-objects to take an optional argument for fsck msgs
 - index-pack: test and document --strict=<msg-id>=<severity>...

 The "--fsck-objects" option of "git index-pack" now can take the
 optional parameter to tweak severity of different fsck errors.

 Expecting a reroll.
 cf. <BF772E83-2BFE-4652-A742-67FADF3D8FE2@gmail.com>
 source: <pull.1658.v3.git.git.1706302749.gitgitgadget@gmail.com>


* zf/subtree-split-fix (2024-01-25) 1 commit
  (merged to 'next' on 2024-01-26 at a09e02f208)
 + subtree: fix split processing with multiple subtrees present

 "git subtree" (in contrib/) update.

 Will merge to 'master'.
 source: <pull.1587.v6.git.1701442494319.gitgitgadget@gmail.com>


* ps/reftable-multi-level-indices-fix (2024-01-26) 6 commits
 - reftable: document reading and writing indices
 - reftable/writer: fix writing multi-level indices
 - reftable/writer: simplify writing index records
 - reftable/writer: use correct type to iterate through index entries
 - reftable/reader: be more careful about errors in indexed seeks
 - Merge branch 'jc/reftable-core-fsync' into ps/reftable-multi-level-indices-fix
 (this branch uses jc/reftable-core-fsync.)

 Write multi-level indices for reftable has been corrected.
 source: <cover.1706263918.git.ps@pks.im>


* kl/allow-working-in-dot-git-in-non-bare-repository (2024-01-20) 1 commit
  (merged to 'next' on 2024-01-24 at e77b796e11)
 + setup: allow cwd=.git w/ bareRepository=explicit

 Loosen "disable repository discovery of a bare repository" check,
 triggered by setting safe.bareRepository configuration variable to
 'explicit', to exclude the ".git/" directory inside a non-bare
 repository from the check.

 Will merge to 'master'.
 source: <pull.1645.git.1705709303098.gitgitgadget@gmail.com>


* rs/parse-options-with-keep-unknown-abbrev-fix (2024-01-22) 2 commits
  (merged to 'next' on 2024-01-23 at a216b482cd)
 + parse-options: simplify positivation handling
 + parse-options: fully disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN

 "git diff --no-rename A B" did not disable rename detection but did
 not trigger an error from the command line parser.

 Will merge to 'master'.
 source: <579fd5bc-3bfd-427f-b22d-dab5e7e56eb2@web.de>
 source: <fb3c679a-5f00-4934-b028-6b2d081cd5b2@web.de>


* pb/ci-github-skip-logs-for-broken-tests (2024-01-22) 1 commit
  (merged to 'next' on 2024-01-23 at f5e3ab2092)
 + ci(github): also skip logs of broken test cases

 GitHub CI update.

 Will merge to 'master'.
 cf. <dbe25fff-e1d4-41f2-8f8f-c538e8c2a77e@github.com>
 source: <pull.1649.git.git.1705808313306.gitgitgadget@gmail.com>


* pb/complete-log-more (2024-01-22) 4 commits
  (merged to 'next' on 2024-01-24 at 081d2a92fa)
 + completion: complete missing 'git log' options
 + completion: complete --encoding
 + completion: complete --patch-with-raw
 + completion: complete missing rev-list options

 The completion script (in contrib/) learned more options that can
 be used with "git log".

 Will merge to 'master'.
 source: <pull.1650.git.git.1705810071.gitgitgadget@gmail.com>


* jc/reftable-core-fsync (2024-01-23) 1 commit
  (merged to 'next' on 2024-01-24 at cea12beddb)
 + reftable: honor core.fsync
 (this branch is used by ps/reftable-multi-level-indices-fix.)

 The write codepath for the reftable data learned to honor
 core.fsync configuration.

 Will merge to 'master'.
 source: <pull.1654.git.git.1706035870956.gitgitgadget@gmail.com>


* ad/custom-merge-placeholder-for-symbolic-pathnames (2024-01-24) 1 commit
  (merged to 'next' on 2024-01-24 at d9cf4e227d)
 + merge-ll: expose revision names to custom drivers

 The labels on conflict markers for the common ancestor, our version,
 and the other version are available to custom 3-way merge driver
 via %S, %X, and %Y placeholders.

 Will merge to 'master'.
 source: <pull.1648.v4.git.git.1706126951879.gitgitgadget@gmail.com>


* cp/unit-test-prio-queue (2024-01-22) 1 commit
 - tests: move t0009-prio-queue.sh to the new unit testing framework

 Migrate priority queue test to unit testing framework.
 source: <pull.1642.v4.git.1705865326185.gitgitgadget@gmail.com>


* jc/reffiles-tests (2024-01-22) 12 commits
  (merged to 'next' on 2024-01-24 at 0d1aaa6807)
 + t5312: move reffiles specific tests to t0601
 + t4202: move reffiles specific tests to t0600
 + t3903: make drop stash test ref backend agnostic
 + t1503: move reffiles specific tests to t0600
 + t1415: move reffiles specific tests to t0601
 + t1410: move reffiles specific tests to t0600
 + t1406: move reffiles specific tests to t0600
 + t1405: move reffiles specific tests to t0601
 + t1404: move reffiles specific tests to t0600
 + t1414: convert test to use Git commands instead of writing refs manually
 + remove REFFILES prerequisite for some tests in t1405 and t2017
 + t3210: move to t0601

 Tests on ref API are moved around to prepare for reftable.

 Will merge to 'master'.
 cf. <Za5TW-q4cKS8pNNc@tanuki>
 source: <pull.1647.v2.git.git.1705695540.gitgitgadget@gmail.com>


* ml/log-merge-with-cherry-pick-and-other-pseudo-heads (2024-01-17) 2 commits
 - revision: implement `git log --merge` also for rebase/cherry_pick/revert
 - revision: ensure MERGE_HEAD is a ref in prepare_show_merge

 "git log --merge" learned to pay attention to CHERRY_PICK_HEAD and
 other kinds of *_HEAD pseudorefs.

 Comments?
 source: <xmqqzfxa9usx.fsf@gitster.g>


* kn/for-all-refs (2024-01-29) 4 commits
 - for-each-ref: avoid filtering on empty pattern
 - refs: introduce `refs_for_each_all_refs()`
 - refs: extract out `loose_fill_ref_dir_regular_file()`
 - refs: introduce `is_pseudoref()` and `is_headref()`

 "git for-each-ref" filters its output with prefixes given from the
 command line, but it did not honor an empty string to mean "pass
 everything", which has been corrected.

 Will merge to 'next'.
 source: <20240129113527.607022-1-karthik.188@gmail.com>


* bk/complete-bisect (2024-01-29) 8 commits
 - completion: add tests for git-bisect
 - completion: bisect: recognize but do not complete view subcommand
 - completion: bisect: complete log opts for visualize subcommand
 - completion: log: use __git_complete_log_opts
 - completion: new function __git_complete_log_opts
 - completion: bisect: complete missing --first-parent and --no-checkout options
 - completion: bisect: complete custom terms and related options
 - completion: bisect: complete bad, new, old, and help subcommands

 Command line completion support (in contrib/) has been
 updated for "git bisect".

 Comments?
 cf. <ZaofJhHsFjRxx7a3@tanuki>
 source: <20240128223447.342493-1-britton.kerin@gmail.com>


* bk/complete-dirname-for-am-and-format-patch (2024-01-12) 1 commit
 - completion: dir-type optargs for am, format-patch

 Command line completion support (in contrib/) has been
 updated for a few commands to complete directory names where a
 directory name is expected.

 Needs review.
 source: <d37781c3-6af2-409b-95a8-660a9b92d20b@smtp-relay.sendinblue.com>


* bk/complete-send-email (2024-01-12) 1 commit
 - completion: don't complete revs when --no-format-patch

 Command line completion support (in contrib/) has been taught to
 avoid offering revision names as candidates to "git send-email" when
 the command is used to send pre-generated files.

 Needs review.
 source: <a718b5ee-afb0-44bd-a299-3208fac43506@smtp-relay.sendinblue.com>


* la/trailer-api (2024-01-26) 10 commits
 - trailer: delete obsolete argument handling code from API
 - trailer: move arg handling to interpret-trailers.c
 - trailer: prepare to move parse_trailers_from_command_line_args () to builtin
 - trailer: spread usage of "trailer_block" language
 - trailer: make trailer_info struct private
 - sequencer: use the trailer iterator
 - trailer: delete obsolete formatting functions
 - trailer: unify trailer formatting machinery
 - trailer: move interpret_trailers() to interpret-trailers.c
 - trailer: prepare to expose functions as part of API

 Code clean-up.

 Expecting a (hopefully final and small) reroll.
 cf. <owlyh6iy2grk.fsf@fine.c.googlers.com>
 source: <pull.1632.v2.git.1706308737.gitgitgadget@gmail.com>


* ps/tests-with-ref-files-backend (2024-01-29) 6 commits
 - t: mark tests regarding git-pack-refs(1) to be backend specific
 - t5526: break test submodule differently
 - t1419: mark test suite as files-backend specific
 - t1302: make tests more robust with new extensions
 - t1301: mark test for `core.sharedRepository` as reffiles specific
 - t1300: make tests more robust with non-default ref backends

 Prepare existing tests on refs to work better with non-default
 backends.

 Will merge to 'next'.
 source: <cover.1706525813.git.ps@pks.im>


* rj/advice-disable-how-to-disable (2024-01-16) 2 commits
  (merged to 'next' on 2024-01-23 at f456f4937d)
 + advice: allow disabling the automatic hint in advise_if_enabled()
 + Merge branch 'rj/advice-delete-branch-not-fully-merged' into rj/advice-disable-how-to-disable

 All conditional "advice" messages show how to turn them off, which
 becomes repetitive.  Add a configuration variable to omit the
 instruction.

 Will merge to 'master'.
 source: <6a842ef8-b390-4739-9eef-e867d55ed5ea@gmail.com>


* sd/negotiate-trace-fix (2024-01-03) 1 commit
  (merged to 'next' on 2024-01-24 at 6305853ab2)
 + push: region_leave trace for negotiate_using_fetch

 Tracing fix.

 Will merge to 'master'.
 source: <20240103224054.1940209-1-delmerico@google.com>


* cp/apply-core-filemode (2023-12-26) 3 commits
 - apply: code simplification
 - apply: correctly reverse patch's pre- and post-image mode bits
 - apply: ignore working tree filemode when !core.filemode

 "git apply" on a filesystem without filemode support have learned
 to take a hint from what is in the index for the path, even when
 not working with the "--index" or "--cached" option, when checking
 the executable bit match what is required by the preimage in the
 patch.

 Needs review.
 source: <20231226233218.472054-1-gitster@pobox.com>


* ja/doc-placeholders-fix (2023-12-26) 2 commits
 - doc: enforce placeholders in documentation
 - doc: enforce dashes in placeholders

 Docfix.

 Needs review.
 source: <pull.1626.git.1703539287.gitgitgadget@gmail.com>


* jc/bisect-doc (2023-12-09) 1 commit
 - bisect: document "terms" subcommand more fully

 Doc update.

 Needs review.
 source: <xmqqzfyjmk02.fsf@gitster.g>


* tb/pair-chunk-expect (2023-11-10) 8 commits
 - midx: read `OOFF` chunk with `pair_chunk_expect()`
 - midx: read `OIDL` chunk with `pair_chunk_expect()`
 - commit-graph: read `BIDX` chunk with `pair_chunk_expect()`
 - commit-graph: read `GDAT` chunk with `pair_chunk_expect()`
 - commit-graph: read `CDAT` chunk with `pair_chunk_expect()`
 - commit-graph: read `OIDL` chunk with `pair_chunk_expect()`
 - chunk-format: introduce `pair_chunk_expect()` helper
 - Merge branch 'jk/chunk-bounds-more' into HEAD

 Further code clean-up.

 Needs review.
 source: <cover.1699569246.git.me@ttaylorr.com>


* tb/path-filter-fix (2024-01-16) 17 commits
 - bloom: introduce `deinit_bloom_filters()`
 - commit-graph: reuse existing Bloom filters where possible
 - object.h: fix mis-aligned flag bits table
 - commit-graph: drop unnecessary `graph_read_bloom_data_context`
 - commit-graph.c: unconditionally load Bloom filters
 - bloom: prepare to discard incompatible Bloom filters
 - bloom: annotate filters with hash version
 - commit-graph: new Bloom filter version that fixes murmur3
 - repo-settings: introduce commitgraph.changedPathsVersion
 - t4216: test changed path filters with high bit paths
 - t/helper/test-read-graph: implement `bloom-filters` mode
 - bloom.h: make `load_bloom_filter_from_graph()` public
 - t/helper/test-read-graph.c: extract `dump_graph_info()`
 - gitformat-commit-graph: describe version 2 of BDAT
 - commit-graph: ensure Bloom filters are read with consistent settings
 - revision.c: consult Bloom filters for root commits
 - t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()`

 The Bloom filter used for path limited history traversal was broken
 on systems whose "char" is unsigned; update the implementation and
 bump the format version to 2.

 Expecting a reroll.
 cf. <20240129212614.GB9612@szeder.dev>
 source: <cover.1705442923.git.me@ttaylorr.com>


* ak/color-decorate-symbols (2023-10-23) 7 commits
 - log: add color.decorate.pseudoref config variable
 - refs: exempt pseudorefs from pattern prefixing
 - refs: add pseudorefs array and iteration functions
 - log: add color.decorate.ref config variable
 - log: add color.decorate.symbol config variable
 - log: use designated inits for decoration_colors
 - config: restructure color.decorate documentation

 A new config for coloring.

 Needs review.
 source: <20231023221143.72489-1-andy.koppe@gmail.com>


* eb/hash-transition (2023-10-02) 30 commits
 - t1016-compatObjectFormat: add tests to verify the conversion between objects
 - t1006: test oid compatibility with cat-file
 - t1006: rename sha1 to oid
 - test-lib: compute the compatibility hash so tests may use it
 - builtin/ls-tree: let the oid determine the output algorithm
 - object-file: handle compat objects in check_object_signature
 - tree-walk: init_tree_desc take an oid to get the hash algorithm
 - builtin/cat-file: let the oid determine the output algorithm
 - rev-parse: add an --output-object-format parameter
 - repository: implement extensions.compatObjectFormat
 - object-file: update object_info_extended to reencode objects
 - object-file-convert: convert commits that embed signed tags
 - object-file-convert: convert commit objects when writing
 - object-file-convert: don't leak when converting tag objects
 - object-file-convert: convert tag objects when writing
 - object-file-convert: add a function to convert trees between algorithms
 - object: factor out parse_mode out of fast-import and tree-walk into in object.h
 - cache: add a function to read an OID of a specific algorithm
 - tag: sign both hashes
 - commit: export add_header_signature to support handling signatures on tags
 - commit: convert mergetag before computing the signature of a commit
 - commit: write commits for both hashes
 - object-file: add a compat_oid_in parameter to write_object_file_flags
 - object-file: update the loose object map when writing loose objects
 - loose: compatibilty short name support
 - loose: add a mapping between SHA-1 and SHA-256 for loose objects
 - repository: add a compatibility hash algorithm
 - object-names: support input of oids in any supported hash
 - oid-array: teach oid-array to handle multiple kinds of oids
 - object-file-convert: stubs for converting from one object format to another

 Teach a repository to work with both SHA-1 and SHA-256 hash algorithms.

 Needs review.
 source: <878r8l929e.fsf@gmail.froward.int.ebiederm.org>


* jx/remote-archive-over-smart-http (2024-01-22) 6 commits
  (merged to 'next' on 2024-01-23 at 5fa4633015)
 + transport-helper: call do_take_over() in process_connect
 + transport-helper: call do_take_over() in connect_helper
 + http-backend: new rpc-service for git-upload-archive
 + transport-helper: protocol v2 supports upload-archive
 + remote-curl: supports git-upload-archive service
 + transport-helper: no connection restriction in connect_helper

 "git archive --remote=<remote>" learned to talk over the smart
 http (aka stateless) transport.

 Will merge to 'master'.
 source: <cover.1705841443.git.zhiyou.jx@alibaba-inc.com>


* jc/rerere-cleanup (2023-08-25) 4 commits
 - rerere: modernize use of empty strbuf
 - rerere: try_merge() should use LL_MERGE_ERROR when it means an error
 - rerere: fix comment on handle_file() helper
 - rerere: simplify check_one_conflict() helper function

 Code clean-up.

 Not ready to be reviewed yet.
 source: <20230824205456.1231371-1-gitster@pobox.com>

^ permalink raw reply

* Re: [PATCH v2 01/10] trailer: prepare to expose functions as part of API
From: Josh Steadmon @ 2024-01-30  0:44 UTC (permalink / raw)
  To: Linus Arver via GitGitGadget
  Cc: git, Christian Couder, Junio C Hamano, Emily Shaffer,
	Randall S. Becker, Linus Arver
In-Reply-To: <e2d3ed9b5b6d67273c22671374daf7695c67709f.1706308737.git.gitgitgadget@gmail.com>

On 2024.01.26 22:38, Linus Arver via GitGitGadget wrote:
> From: Linus Arver <linusa@google.com>
> 
> In the next patch, we will move "process_trailers" from trailer.c to
> builtin/interpret-trailers.c. That move will necessitate the growth of
> the trailer.h API, forcing us to expose some additional functions in
> trailer.h.
> 
> Rename relevant functions so that they include the term "trailer" in
> their name, so that clients of the API will be able to easily identify
> them by their "trailer" moniker, just like all the other functions
> already exposed by trailer.h.
> 
> The the opportunity to start putting trailer processions options (opts)

Nitpick: typo in the commit message.
s/The the opportunity/Take the opportunity/ ?

> as the first parameter. This will be the pattern going forward in this
> series.
> 
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Linus Arver <linusa@google.com>
> ---
>  builtin/interpret-trailers.c |  4 ++--
>  trailer.c                    | 26 +++++++++++++-------------
>  trailer.h                    |  6 +++---
>  3 files changed, 18 insertions(+), 18 deletions(-)

^ permalink raw reply

* Re: [PATCH 2/2] t/Makefile: get UNIT_TESTS list from C sources
From: Junio C Hamano @ 2024-01-30  0:27 UTC (permalink / raw)
  To: Adam Dinwoodie; +Cc: Jeff King, Patrick Steinhardt, git, Phillip Wood
In-Reply-To: <CA+kUOanDydgCEax9RFu_xVXkx_LeiSPOoWiUpwAg=EVQxSDJRw@mail.gmail.com>

Adam Dinwoodie <adam@dinwoodie.org> writes:

>> Hmm, good point. It seems like the answer should obviously be "yes", but
>> Windows CI seemed to pass all the same (and I checked that it indeed ran
>> the unit tests). Do we only get the $X suffix for MSVC builds or
>> something? Looks like maybe cygwin, as well.
>
> Cygwin will automatically append ".exe" when doing directory listings;
> a check if the file "a" exists will return true on Cygwin if "a" or
> "a.exe" exists; a glob for "a*" in a directory containing files "a1"
> and "a2.exe" will return "a1" and "a2". This causes problems in some
> edge cases, but it means *nix scripts and applications are much more
> likely to work without any Cygwin-specific handling. I *think* this
> logic is carried downstream to MSYS2 and thence to Git for Windows.

Interesting, especially that "a*" is globbed to "a2" and not
"a2.exe".

> As a result, I'm not surprised this worked without handling $X, but I
> don't think there's any harm in adding it either.

OK.

I wonder if something like this is sufficient?  I am not sure if we
should lift the building of t/unit-tests/* up to the primary Makefile
to mimic the way stuff related to test-tool are built and linked.
That way, we do not have to contaminate t/Makefile with compilation
related stuff that we didn't need originally.

 t/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git c/t/Makefile w/t/Makefile
index b7a6fefe28..010ce083b1 100644
--- c/t/Makefile
+++ w/t/Makefile
@@ -6,6 +6,7 @@ include ../shared.mak
 # Copyright (c) 2005 Junio C Hamano
 #
 
+include ../config.mak.uname
 -include ../config.mak.autogen
 -include ../config.mak
 
@@ -42,7 +43,9 @@ TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
 TINTEROP = $(sort $(wildcard interop/i[0-9][0-9][0-9][0-9]-*.sh))
 CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
 CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl
-UNIT_TESTS = $(sort $(filter-out %.pdb unit-tests/bin/t-basic%,$(wildcard unit-tests/bin/t-*)))
+UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
+UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%$X,$(UNIT_TEST_SOURCES))
+UNIT_TESTS = $(sort $(filter-out unit-tests/bin/t-basic%,$(UNIT_TEST_PROGRAMS)))
 
 # `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
 # checks all tests in all scripts via a single invocation, so tell individual



^ permalink raw reply related

* Re: [PATCH v2 03/10] trailer: unify trailer formatting machinery
From: Josh Steadmon @ 2024-01-30  0:24 UTC (permalink / raw)
  To: Linus Arver via GitGitGadget
  Cc: git, Christian Couder, Junio C Hamano, Emily Shaffer,
	Randall S. Becker, Linus Arver
In-Reply-To: <9b7747d550e87457195c40a49347bc749a7290d0.1706308737.git.gitgitgadget@gmail.com>

On 2024.01.26 22:38, Linus Arver via GitGitGadget wrote:
> From: Linus Arver <linusa@google.com>
> 
> Currently have two functions for formatting trailers exposed in
> trailer.h:
> 
>     void format_trailers(FILE *outfile, struct list_head *head,
>                         const struct process_trailer_options *opts);
> 
>     void format_trailers_from_commit(struct strbuf *out, const char *msg,
>                                     const struct process_trailer_options *opts);
> 
> and previously these functions, although similar enough (even taking the
> same process_trailer_options struct pointer), did not build on each
> other.
> 
> Make format_trailers_from_commit() rely on format_trailers(). Teach
> format_trailers() to process trailers with the additional
> process_trailer_options fields like opts->key_only which is only used by
> format_trailers_from_commit() and not builtin/interpret-trailers.c.
> While we're at it, reorder parameters to put the trailer processing
> options first, and the out parameter (strbuf we write into) at the end.
> 
> This unification will allow us to delete the format_trailer_info() and
> print_tok_val() functions in the next patch. They are not deleted here
> in order to keep the diff small.

Unfortunately this breaks the build:

trailer.c:1145:13: error: ‘format_trailer_info’ defined but not used [-Werror=unused-function]

and

trailer.c:147:13: error: ‘print_tok_val’ defined but not used [-Werror=unused-function]

While separating this patch from the deletion does make it easier to
review, it may make bisection more difficult.

^ permalink raw reply

* Re: [PATCH v5 09/17] repo-settings: introduce commitgraph.changedPathsVersion
From: Taylor Blau @ 2024-01-29 23:58 UTC (permalink / raw)
  To: SZEDER Gábor, Junio C Hamano
  Cc: git, Elijah Newren, Eric W. Biederman, Jeff King,
	Patrick Steinhardt, Jonathan Tan
In-Reply-To: <20240129212614.GB9612@szeder.dev>

On Mon, Jan 29, 2024 at 10:26:14PM +0100, SZEDER Gábor wrote:
> At this point in the series this test fails with:
>
>   + test_cmp expect.err err
>   + test 2 -ne 2
>   + eval diff -u "$@"
>   + diff -u expect.err err
>   --- expect.err  2024-01-29 21:02:57.927462620 +0000
>   +++ err 2024-01-29 21:02:57.923462642 +0000
>   @@ -1 +0,0 @@
>   -warning: disabling Bloom filters for commit-graph layer 'e338a7a1b4cfa5f6bcd31aea3e027df67d06442a' due to incompatible settings
>   error: last command exited with $?=1

Very good catch, thanks, I'm not sure how this one slipped through.

The fix should be mostly trivial, but I'll have to reroll the series
since it has some minor fallout outside of just this patch.

Junio, please hold off on merging this to 'next' until I've had a chance
to send out a new round.

Thanks,
Taylor

^ permalink raw reply

* Re: [PATCH 1/4] t0080: mark as leak-free
From: Junio C Hamano @ 2024-01-29 23:51 UTC (permalink / raw)
  To: Rubén Justo; +Cc: Git List
In-Reply-To: <c932fbfc-f14f-4403-bfc5-cf1d616b22de@gmail.com>

Rubén Justo <rjusto@gmail.com> writes:

>> The point of the t-basic tests is to ensure the lightweight unit
>> test framework that requires nothing from Git behaves (and keeps
>> behaving) sensibly.  The point of running t[0-9][0-9][0-9][0-9]
>> tests under leak sanitizer is to exercise production Git code to
>> catch leaks in Git code.
>> 
>> So it is not quite clear if we even want to run this t0080 under
>> leak sanitizer to begin with.  t0080 is a relatively tiny test, but
>> do we even want to spend leak sanitizer cycles on it?  I dunno.
>
> IIUC, that would imply building test-tool with a different set of flags
> than Git, new artifacts ...  or running test-tool with some LSAN_OPTIONS
> options, to disable it ...  or both ... or ...
>
> And that is assuming that with test-tool we won't catch a leak in Git
> that we're not seeing in the other tests ...

But t0080 does not even run test-tool, does it?  The t-basic unit
test is about testing the unit test framework and does not even
trigger any of the half-libified Git code.  So I am not sure why
you are bringing up test-tool into the picture.

> Maybe this is tangential to this series but,  while a decision is being
> made, annotating the test makes GIT_TEST_PASSING_SANITIZE_LEAK=check
> pass, which is the objective in this series. 

One major reason why we want to set TEST_PASSES_SANITIZE_LEAK to
true is because that way the marked test will be run under the leak
sanitizer in the CI.

What do we expect to gain by running t0080, which is to run the
t-basic unit test, under the leak sanitizer?  Unlike other
t[0-9][0-9][0-9][0-9] tests that exercise Git production code, would
we care about a new leak found in t-basic run from t0080 in the
first place?

Annotating with TEST_PASSES_SANITIZE_LEAK is not a goal by itself.
Annotating the tests that we want to run under the sanitizer and see
them passing with it is.  And obviously these tests that exercise
Git production code are very good candidates for us to do so.  It is
unclear if t0080 falls into the same category.  That is why I asked
what we expect to gain by running it.

Thanks.

^ permalink raw reply

* Re: [PATCH 1/4] t0080: mark as leak-free
From: Rubén Justo @ 2024-01-29 23:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git List
In-Reply-To: <xmqqa5onhjm4.fsf@gitster.g>

On 29-ene-2024 14:15:15, Junio C Hamano wrote:
> Rubén Justo <rjusto@gmail.com> writes:
> 
> > This test is leak-free since it was added in e137fe3b29 (unit tests: add
> > TAP unit test framework, 2023-11-09)
> >
> > Let's mark it as leak-free to make sure it stays that way (and to reduce
> > noise when looking for other leak-free scripts after we fix some leaks).
> 
> For other tests in this series, that rationale is a very sensible
> thing, but does it apply to this one?
> 
> The point of the t-basic tests is to ensure the lightweight unit
> test framework that requires nothing from Git behaves (and keeps
> behaving) sensibly.  The point of running t[0-9][0-9][0-9][0-9]
> tests under leak sanitizer is to exercise production Git code to
> catch leaks in Git code.
> 
> So it is not quite clear if we even want to run this t0080 under
> leak sanitizer to begin with.  t0080 is a relatively tiny test, but
> do we even want to spend leak sanitizer cycles on it?  I dunno.

IIUC, that would imply building test-tool with a different set of flags
than Git, new artifacts ...  or running test-tool with some LSAN_OPTIONS
options, to disable it ...  or both ... or ...

And that is assuming that with test-tool we won't catch a leak in Git
that we're not seeing in the other tests ...

Maybe this is tangential to this series but,  while a decision is being
made, annotating the test makes GIT_TEST_PASSING_SANITIZE_LEAK=check
pass, which is the objective in this series. 

> 
> > Signed-off-by: Rubén Justo <rjusto@gmail.com>
> > ---
> >  t/t0080-unit-test-output.sh | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/t/t0080-unit-test-output.sh b/t/t0080-unit-test-output.sh
> > index 961b54b06c..6657c114a3 100755
> > --- a/t/t0080-unit-test-output.sh
> > +++ b/t/t0080-unit-test-output.sh
> > @@ -2,6 +2,7 @@
> >  
> >  test_description='Test the output of the unit test framework'
> >  
> > +TEST_PASSES_SANITIZE_LEAK=true
> >  . ./test-lib.sh
> >  
> >  test_expect_success 'TAP output from unit tests' '

^ permalink raw reply

* Re: [PATCH 4/4] test-lib: check for TEST_PASSES_SANITIZE_LEAK
From: Junio C Hamano @ 2024-01-29 22:25 UTC (permalink / raw)
  To: Rubén Justo; +Cc: Git List
In-Reply-To: <6447b11b-f916-4079-8936-8d4f6c480f57@gmail.com>

Rubén Justo <rjusto@gmail.com> writes:

> In a recent commit we fixed a test where it was set after sourcing
> test-lib.sh, leading to confusing results.

OK, the reference is to the previous step.  Makes sense.

>
> To prevent future oversights, let's add a simple check to ensure the
> value for TEST_PASSES_SANITIZE_LEAK remains unchanged at test_done().
>
> Signed-off-by: Rubén Justo <rjusto@gmail.com>
> ---
>  t/test-lib.sh | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index fc93aa57e6..042f557a6f 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1297,6 +1297,11 @@ test_done () {
>  		EOF
>  	fi
>  
> +	if test -z "$passes_sanitize_leak" && test_bool_env TEST_PASSES_SANITIZE_LEAK false
> +	then
> +		BAIL_OUT "Please, set TEST_PASSES_SANITIZE_LEAK before sourcing test-lib.sh"
> +	fi
> +
>  	if test "$test_fixed" != 0
>  	then
>  		say_color error "# $test_fixed known breakage(s) vanished; please update test(s)"

^ permalink raw reply

* Re: [PATCH 1/4] t0080: mark as leak-free
From: Junio C Hamano @ 2024-01-29 22:15 UTC (permalink / raw)
  To: Rubén Justo; +Cc: Git List
In-Reply-To: <4adfcba4-0f2b-44f5-a312-97f00f979435@gmail.com>

Rubén Justo <rjusto@gmail.com> writes:

> This test is leak-free since it was added in e137fe3b29 (unit tests: add
> TAP unit test framework, 2023-11-09)
>
> Let's mark it as leak-free to make sure it stays that way (and to reduce
> noise when looking for other leak-free scripts after we fix some leaks).

For other tests in this series, that rationale is a very sensible
thing, but does it apply to this one?

The point of the t-basic tests is to ensure the lightweight unit
test framework that requires nothing from Git behaves (and keeps
behaving) sensibly.  The point of running t[0-9][0-9][0-9][0-9]
tests under leak sanitizer is to exercise production Git code to
catch leaks in Git code.

So it is not quite clear if we even want to run this t0080 under
leak sanitizer to begin with.  t0080 is a relatively tiny test, but
do we even want to spend leak sanitizer cycles on it?  I dunno.

> Signed-off-by: Rubén Justo <rjusto@gmail.com>
> ---
>  t/t0080-unit-test-output.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/t/t0080-unit-test-output.sh b/t/t0080-unit-test-output.sh
> index 961b54b06c..6657c114a3 100755
> --- a/t/t0080-unit-test-output.sh
> +++ b/t/t0080-unit-test-output.sh
> @@ -2,6 +2,7 @@
>  
>  test_description='Test the output of the unit test framework'
>  
> +TEST_PASSES_SANITIZE_LEAK=true
>  . ./test-lib.sh
>  
>  test_expect_success 'TAP output from unit tests' '

^ permalink raw reply

* Re: [PATCH 1/2] Makefile: use order-only prereq for UNIT_TEST_BIN
From: Junio C Hamano @ 2024-01-29 22:06 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Jeff King, git, Phillip Wood
In-Reply-To: <20240129202201.GA9612@szeder.dev>

SZEDER Gábor <szeder.dev@gmail.com> writes:

> A third alternative is to use $(call mkdir_p_parent_template) in the
> recipe and get rid of the thus unnecessary UNIT_TEST_BIN dependency
> and target.

Yeah, that sounds like a good approach in this case.

> On a related note, 'make clean' doesn't remove this 't/unit-tests/bin'
> directory.

Not a new problem, but I did notice this, too.

Thanks.

 Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git c/Makefile w/Makefile
index 958f4cd0bf..7f035a1c9f 100644
--- c/Makefile
+++ w/Makefile
@@ -3676,7 +3676,7 @@ cocciclean:
 	$(RM) contrib/coccinelle/*.cocci.patch
 
 clean: profile-clean coverage-clean cocciclean
-	$(RM) -r .build
+	$(RM) -r .build $(UNIT_TEST_BIN)
 	$(RM) po/git.pot po/git-core.pot
 	$(RM) git.res
 	$(RM) $(OBJECTS)
@@ -3863,10 +3863,8 @@ $(FUZZ_PROGRAMS): all
 
 fuzz-all: $(FUZZ_PROGRAMS)
 
-$(UNIT_TEST_BIN):
-	@mkdir -p $(UNIT_TEST_BIN)
-
-$(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_DIR)/test-lib.o $(GITLIBS) GIT-LDFLAGS | $(UNIT_TEST_BIN)
+$(UNIT_TEST_PROGS): $(UNIT_TEST_BIN)/%$X: $(UNIT_TEST_DIR)/%.o $(UNIT_TEST_DIR)/test-lib.o $(GITLIBS) GIT-LDFLAGS
+	$(call mkdir_p_parent_template)
 	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
 		$(filter %.o,$^) $(filter %.a,$^) $(LIBS)
 

^ permalink raw reply related

* Re: [PATCH 2/2] t/Makefile: get UNIT_TESTS list from C sources
From: Junio C Hamano @ 2024-01-29 21:51 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Phillip Wood
In-Reply-To: <20240129031933.GB2433899@coredump.intra.peff.net>

Jeff King <peff@peff.net> writes:

> Our new wildcard does make an assumption that unit tests are build from

"build" -> "built", probably.

> C sources. It would be a bit cleaner if we consulted UNIT_TEST_PROGRAMS
> from the top-level Makefile. But doing so is tricky unless we reorganize
> that Makefile to split the source file lists into include-able subfiles.
> That might be worth doing in general, but in the meantime, the
> assumptions made by the wildcard here seems reasonable.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> I of course hit this when moving between "next" and "master" for an
> up-and-coming unit-test file which sometimes failed.

Thanks.  globbing the build products is indeed sloppy for all the
reasons you mentioned.  Will queue.

>  t/Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/t/Makefile b/t/Makefile
> index b7a6fefe28..c5c6e2ef6b 100644
> --- a/t/Makefile
> +++ b/t/Makefile
> @@ -42,7 +42,9 @@ TPERF = $(sort $(wildcard perf/p[0-9][0-9][0-9][0-9]-*.sh))
>  TINTEROP = $(sort $(wildcard interop/i[0-9][0-9][0-9][0-9]-*.sh))
>  CHAINLINTTESTS = $(sort $(patsubst chainlint/%.test,%,$(wildcard chainlint/*.test)))
>  CHAINLINT = '$(PERL_PATH_SQ)' chainlint.pl
> -UNIT_TESTS = $(sort $(filter-out %.pdb unit-tests/bin/t-basic%,$(wildcard unit-tests/bin/t-*)))
> +UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
> +UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%,$(UNIT_TEST_SOURCES))
> +UNIT_TESTS = $(sort $(filter-out unit-tests/bin/t-basic%,$(UNIT_TEST_PROGRAMS)))
>  
>  # `test-chainlint` (which is a dependency of `test-lint`, `test` and `prove`)
>  # checks all tests in all scripts via a single invocation, so tell individual

^ permalink raw reply

* Re: what should "git clean -n -f [-d] [-x] <pattern>" do?
From: Sergey Organov @ 2024-01-29 21:49 UTC (permalink / raw)
  To: Jeff King; +Cc: Junio C Hamano, Elijah Newren, git
In-Reply-To: <20240129182006.GC3765717@coredump.intra.peff.net>

Jeff King <peff@peff.net> writes:

> On Mon, Jan 29, 2024 at 12:35:49PM +0300, Sergey Organov wrote:
>
>> >> I'm still arguing in favor of fixing "-n", and I believe a fix is needed
>> >> independently from decision about "-f -f".
>> >
>> > Even though I do not personally like it, I do not think "which
>> > between do-it (f) and do-not-do-it (n) do you want to use?" is
>> > broken.  It sometimes irritates me to find "git clean" (without "-f"
>> > or "-n", and with clean.requireForce not disabled) complain, and I
>> > personally think "git clean" when clean.requireForce is in effect
>> > and no "-n" or "-f" were given should pretend as if "-n" were given.
>> 
>> As a note, I'd consider to get rid of 'clean.requireForce' anyway, as
>> its default value provides safe reasonably behaving environment, and I
>> fail to see why anybody would need to set it to 'false'.
>
> Please don't. I set it to "false", because I find the default behavior a
> pointless roadblock if you are already aware that "git clean" can be
> destructive. Surely I can't be the only one.

Well, provided there is at least one person who finds it useful to set
it to 'false', I withdraw my suggestion.

That said, did you consider to:

  $ git config --global alias.cl 'clean -f'

instead of

  $ git config --global clean.requireForce false

I wonder?

Thanks,
-- Sergey Organov

^ permalink raw reply

* Re: [PATCH 2/2] t/Makefile: get UNIT_TESTS list from C sources
From: Adam Dinwoodie @ 2024-01-29 21:31 UTC (permalink / raw)
  To: Jeff King; +Cc: Patrick Steinhardt, git, Phillip Wood
In-Reply-To: <20240129174918.GA3765717@coredump.intra.peff.net>

On Mon, 29 Jan 2024 at 17:49, Jeff King wrote:
>
> On Mon, Jan 29, 2024 at 12:26:42PM +0100, Patrick Steinhardt wrote:
>
> > > -UNIT_TESTS = $(sort $(filter-out %.pdb unit-tests/bin/t-basic%,$(wildcard unit-tests/bin/t-*)))
> > > +UNIT_TEST_SOURCES = $(wildcard unit-tests/t-*.c)
> > > +UNIT_TEST_PROGRAMS = $(patsubst unit-tests/%.c,unit-tests/bin/%,$(UNIT_TEST_SOURCES))
> > > +UNIT_TESTS = $(sort $(filter-out unit-tests/bin/t-basic%,$(UNIT_TEST_PROGRAMS)))
> >
> > Wouldn't we have to honor `$X` on Windows systems so that the unit tests
> > have the expected ".exe" suffix here?
>
> Hmm, good point. It seems like the answer should obviously be "yes", but
> Windows CI seemed to pass all the same (and I checked that it indeed ran
> the unit tests). Do we only get the $X suffix for MSVC builds or
> something? Looks like maybe cygwin, as well.

Cygwin will automatically append ".exe" when doing directory listings;
a check if the file "a" exists will return true on Cygwin if "a" or
"a.exe" exists; a glob for "a*" in a directory containing files "a1"
and "a2.exe" will return "a1" and "a2". This causes problems in some
edge cases, but it means *nix scripts and applications are much more
likely to work without any Cygwin-specific handling. I *think* this
logic is carried downstream to MSYS2 and thence to Git for Windows.

As a result, I'm not surprised this worked without handling $X, but I
don't think there's any harm in adding it either.

^ permalink raw reply

* Re: [PATCH v5 09/17] repo-settings: introduce commitgraph.changedPathsVersion
From: SZEDER Gábor @ 2024-01-29 21:26 UTC (permalink / raw)
  To: Taylor Blau
  Cc: git, Elijah Newren, Eric W. Biederman, Jeff King, Junio C Hamano,
	Patrick Steinhardt, Jonathan Tan
In-Reply-To: <a77dcc99b4eb0a19dc6c09a40a84785413502126.1705442923.git.me@ttaylorr.com>

On Tue, Jan 16, 2024 at 05:09:28PM -0500, Taylor Blau wrote:
> A subsequent commit will introduce another version of the changed-path
> filter in the commit graph file. In order to control which version to
> write (and read), a config variable is needed.
> 
> Therefore, introduce this config variable. For forwards compatibility,
> teach Git to not read commit graphs when the config variable
> is set to an unsupported version. Because we teach Git this,
> commitgraph.readChangedPaths is now redundant, so deprecate it and
> define its behavior in terms of the config variable we introduce.
> 
> This commit does not change the behavior of writing (Git writes changed
> path filters when explicitly instructed regardless of any config
> variable), but a subsequent commit will restrict Git such that it will
> only write when commitgraph.changedPathsVersion is a recognized value.
> 
> Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
>  Documentation/config/commitgraph.txt | 26 ++++++++++++++++++++++---
>  commit-graph.c                       |  5 +++--
>  oss-fuzz/fuzz-commit-graph.c         |  2 +-
>  repo-settings.c                      |  6 +++++-
>  repository.h                         |  2 +-
>  t/t4216-log-bloom.sh                 | 29 +++++++++++++++++++++++++++-
>  6 files changed, 61 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/config/commitgraph.txt b/Documentation/config/commitgraph.txt
> index 30604e4a4c..e68cdededa 100644
> --- a/Documentation/config/commitgraph.txt
> +++ b/Documentation/config/commitgraph.txt
> @@ -9,6 +9,26 @@ commitGraph.maxNewFilters::
>  	commit-graph write` (c.f., linkgit:git-commit-graph[1]).
>  
>  commitGraph.readChangedPaths::
> -	If true, then git will use the changed-path Bloom filters in the
> -	commit-graph file (if it exists, and they are present). Defaults to
> -	true. See linkgit:git-commit-graph[1] for more information.
> +	Deprecated. Equivalent to commitGraph.changedPathsVersion=-1 if true, and
> +	commitGraph.changedPathsVersion=0 if false. (If commitGraph.changedPathVersion
> +	is also set, commitGraph.changedPathsVersion takes precedence.)
> +
> +commitGraph.changedPathsVersion::
> +	Specifies the version of the changed-path Bloom filters that Git will read and
> +	write. May be -1, 0 or 1. Note that values greater than 1 may be
> +	incompatible with older versions of Git which do not yet understand
> +	those versions. Use caution when operating in a mixed-version
> +	environment.
> ++
> +Defaults to -1.
> ++
> +If -1, Git will use the version of the changed-path Bloom filters in the
> +repository, defaulting to 1 if there are none.
> ++
> +If 0, Git will not read any Bloom filters, and will write version 1 Bloom
> +filters when instructed to write.
> ++
> +If 1, Git will only read version 1 Bloom filters, and will write version 1
> +Bloom filters.
> ++
> +See linkgit:git-commit-graph[1] for more information.
> diff --git a/commit-graph.c b/commit-graph.c
> index 00113b0f62..91c98ebc6c 100644
> --- a/commit-graph.c
> +++ b/commit-graph.c
> @@ -459,7 +459,7 @@ struct commit_graph *parse_commit_graph(struct repo_settings *s,
>  			graph->read_generation_data = 1;
>  	}
>  
> -	if (s->commit_graph_read_changed_paths) {
> +	if (s->commit_graph_changed_paths_version) {
>  		read_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
>  			   graph_read_bloom_index, graph);
>  		read_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,
> @@ -555,7 +555,8 @@ static void validate_mixed_bloom_settings(struct commit_graph *g)
>  		}
>  
>  		if (g->bloom_filter_settings->bits_per_entry != settings->bits_per_entry ||
> -		    g->bloom_filter_settings->num_hashes != settings->num_hashes) {
> +		    g->bloom_filter_settings->num_hashes != settings->num_hashes ||
> +		    g->bloom_filter_settings->hash_version != settings->hash_version) {
>  			g->chunk_bloom_indexes = NULL;
>  			g->chunk_bloom_data = NULL;
>  			FREE_AND_NULL(g->bloom_filter_settings);
> diff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c
> index 2992079dd9..325c0b991a 100644
> --- a/oss-fuzz/fuzz-commit-graph.c
> +++ b/oss-fuzz/fuzz-commit-graph.c
> @@ -19,7 +19,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
>  	 * possible.
>  	 */
>  	the_repository->settings.commit_graph_generation_version = 2;
> -	the_repository->settings.commit_graph_read_changed_paths = 1;
> +	the_repository->settings.commit_graph_changed_paths_version = 1;
>  	g = parse_commit_graph(&the_repository->settings, (void *)data, size);
>  	repo_clear(the_repository);
>  	free_commit_graph(g);
> diff --git a/repo-settings.c b/repo-settings.c
> index 30cd478762..c821583fe5 100644
> --- a/repo-settings.c
> +++ b/repo-settings.c
> @@ -23,6 +23,7 @@ void prepare_repo_settings(struct repository *r)
>  	int value;
>  	const char *strval;
>  	int manyfiles;
> +	int read_changed_paths;
>  
>  	if (!r->gitdir)
>  		BUG("Cannot add settings for uninitialized repository");
> @@ -53,7 +54,10 @@ void prepare_repo_settings(struct repository *r)
>  	/* Commit graph config or default, does not cascade (simple) */
>  	repo_cfg_bool(r, "core.commitgraph", &r->settings.core_commit_graph, 1);
>  	repo_cfg_int(r, "commitgraph.generationversion", &r->settings.commit_graph_generation_version, 2);
> -	repo_cfg_bool(r, "commitgraph.readchangedpaths", &r->settings.commit_graph_read_changed_paths, 1);
> +	repo_cfg_bool(r, "commitgraph.readchangedpaths", &read_changed_paths, 1);
> +	repo_cfg_int(r, "commitgraph.changedpathsversion",
> +		     &r->settings.commit_graph_changed_paths_version,
> +		     read_changed_paths ? -1 : 0);
>  	repo_cfg_bool(r, "gc.writecommitgraph", &r->settings.gc_write_commit_graph, 1);
>  	repo_cfg_bool(r, "fetch.writecommitgraph", &r->settings.fetch_write_commit_graph, 0);
>  
> diff --git a/repository.h b/repository.h
> index 5f18486f64..f71154e12c 100644
> --- a/repository.h
> +++ b/repository.h
> @@ -29,7 +29,7 @@ struct repo_settings {
>  
>  	int core_commit_graph;
>  	int commit_graph_generation_version;
> -	int commit_graph_read_changed_paths;
> +	int commit_graph_changed_paths_version;
>  	int gc_write_commit_graph;
>  	int fetch_write_commit_graph;
>  	int command_requires_full_index;
> diff --git a/t/t4216-log-bloom.sh b/t/t4216-log-bloom.sh
> index 484dd093cd..642b960893 100755
> --- a/t/t4216-log-bloom.sh
> +++ b/t/t4216-log-bloom.sh
> @@ -435,7 +435,7 @@ test_expect_success 'setup for mixed Bloom setting tests' '
>  	done
>  '
>  
> -test_expect_success 'ensure incompatible Bloom filters are ignored' '
> +test_expect_success 'ensure Bloom filters with incompatible settings are ignored' '
>  	# Compute Bloom filters with "unusual" settings.
>  	git -C $repo rev-parse one >in &&
>  	GIT_TEST_BLOOM_SETTINGS_NUM_HASHES=3 git -C $repo commit-graph write \
> @@ -485,6 +485,33 @@ test_expect_success 'merge graph layers with incompatible Bloom settings' '
>  	test_must_be_empty err
>  '
>  
> +test_expect_success 'ensure Bloom filter with incompatible versions are ignored' '
> +	rm "$repo/$graph" &&
> +
> +	git -C $repo log --oneline --no-decorate -- $CENT >expect &&
> +
> +	# Compute v1 Bloom filters for commits at the bottom.
> +	git -C $repo rev-parse HEAD^ >in &&
> +	git -C $repo commit-graph write --stdin-commits --changed-paths \
> +		--split <in &&
> +
> +	# Compute v2 Bloomfilters for the rest of the commits at the top.
> +	git -C $repo rev-parse HEAD >in &&
> +	git -C $repo -c commitGraph.changedPathsVersion=2 commit-graph write \
> +		--stdin-commits --changed-paths --split=no-merge <in &&
> +
> +	test_line_count = 2 $repo/$chain &&
> +
> +	git -C $repo log --oneline --no-decorate -- $CENT >actual 2>err &&
> +	test_cmp expect actual &&
> +
> +	layer="$(head -n 1 $repo/$chain)" &&
> +	cat >expect.err <<-EOF &&
> +	warning: disabling Bloom filters for commit-graph layer $SQ$layer$SQ due to incompatible settings
> +	EOF
> +	test_cmp expect.err err
> +'

At this point in the series this test fails with:

  + test_cmp expect.err err
  + test 2 -ne 2
  + eval diff -u "$@"
  + diff -u expect.err err
  --- expect.err  2024-01-29 21:02:57.927462620 +0000
  +++ err 2024-01-29 21:02:57.923462642 +0000
  @@ -1 +0,0 @@
  -warning: disabling Bloom filters for commit-graph layer 'e338a7a1b4cfa5f6bcd31aea3e027df67d06442a' due to incompatible settings
  error: last command exited with $?=1


> +
>  get_first_changed_path_filter () {
>  	test-tool read-graph bloom-filters >filters.dat &&
>  	head -n 1 filters.dat
> -- 
> 2.43.0.334.gd4dbce1db5.dirty
> 

^ permalink raw reply

* [PATCH 4/4] test-lib: check for TEST_PASSES_SANITIZE_LEAK
From: Rubén Justo @ 2024-01-29 21:08 UTC (permalink / raw)
  To: Git List
In-Reply-To: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>

TEST_PASSES_SANITIZE_LEAK must be set before sourcing test-lib.sh, as we
say in t/README:

   GIT_TEST_PASSING_SANITIZE_LEAK=true skips those tests that haven't
   declared themselves as leak-free by setting
   "TEST_PASSES_SANITIZE_LEAK=true" before sourcing "test-lib.sh". This
   test mode is used by the "linux-leaks" CI target.

   GIT_TEST_PASSING_SANITIZE_LEAK=check checks that our
   "TEST_PASSES_SANITIZE_LEAK=true" markings are current. Rather than
   skipping those tests that haven't set "TEST_PASSES_SANITIZE_LEAK=true"
   before sourcing "test-lib.sh" this mode runs them with
   "--invert-exit-code". This is used to check that there's a one-to-one
   mapping between "TEST_PASSES_SANITIZE_LEAK=true" and those tests that
   pass under "SANITIZE=leak". This is especially useful when testing a
   series that fixes various memory leaks with "git rebase -x".

In a recent commit we fixed a test where it was set after sourcing
test-lib.sh, leading to confusing results.

To prevent future oversights, let's add a simple check to ensure the
value for TEST_PASSES_SANITIZE_LEAK remains unchanged at test_done().

Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/test-lib.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index fc93aa57e6..042f557a6f 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1297,6 +1297,11 @@ test_done () {
 		EOF
 	fi
 
+	if test -z "$passes_sanitize_leak" && test_bool_env TEST_PASSES_SANITIZE_LEAK false
+	then
+		BAIL_OUT "Please, set TEST_PASSES_SANITIZE_LEAK before sourcing test-lib.sh"
+	fi
+
 	if test "$test_fixed" != 0
 	then
 		say_color error "# $test_fixed known breakage(s) vanished; please update test(s)"
-- 
2.43.0

^ permalink raw reply related

* [PATCH 3/4] t6113: mark as leak-free
From: Rubén Justo @ 2024-01-29 21:08 UTC (permalink / raw)
  To: Git List
In-Reply-To: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>

This test does not leak since a96015a517 (pack-bitmap: plug leak in
find_objects(), 2023-12-14) when the annotation
TEST_PASSES_SANITIZE_LEAK=true was also added.

Unfortunately it was added after test-lib.sh is sourced, which makes
GIT_TEST_PASSING_SANITIZE_LEAK=check error:

   $ make SANITIZE=leak GIT_TEST_PASSING_SANITIZE_LEAK=check test T=t6113-rev-list-bitmap-filters.sh
   ...
   make[2]: Entering directory '/tmp/git/git/t'
   *** t6113-rev-list-bitmap-filters.sh ***
   in GIT_TEST_PASSING_SANITIZE_LEAK=check mode, setting --invert-exit-code for TEST_PASSES_SANITIZE_LEAK != true
   ok 1 - set up bitmapped repo
   ok 2 - filters fallback to non-bitmap traversal
   ok 3 - blob:none filter
   ok 4 - blob:none filter with specified blob
   ok 5 - blob:limit filter
   ok 6 - blob:limit filter with specified blob
   ok 7 - tree:0 filter
   ok 8 - tree:0 filter with specified blob, tree
   ok 9 - tree:1 filter
   ok 10 - object:type filter
   ok 11 - object:type filter with --filter-provided-objects
   ok 12 - combine filter
   ok 13 - combine filter with --filter-provided-objects
   ok 14 - bitmap traversal with --unpacked
   # passed all 14 test(s)
   1..14
   # faking up non-zero exit with --invert-exit-code
   make[2]: *** [Makefile:68: t6113-rev-list-bitmap-filters.sh] Error 1
   make[2]: Leaving directory '/tmp/git/git/t'
   make[1]: *** [Makefile:55: test] Error 2
   make[1]: Leaving directory '/tmp/git/git/t'
   make: *** [Makefile:3212: test] Error 2

Let's move the annotation before sourcing test-lib.sh, to make
GIT_TEST_PASSING_SANITIZE_LEAK=check happy.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t6113-rev-list-bitmap-filters.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t6113-rev-list-bitmap-filters.sh b/t/t6113-rev-list-bitmap-filters.sh
index 459f0d7412..a9656a1ec8 100755
--- a/t/t6113-rev-list-bitmap-filters.sh
+++ b/t/t6113-rev-list-bitmap-filters.sh
@@ -1,10 +1,11 @@
 #!/bin/sh
 
 test_description='rev-list combining bitmaps and filters'
+
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-bitmap.sh
 
-TEST_PASSES_SANITIZE_LEAK=true
 
 test_expect_success 'set up bitmapped repo' '
 	# one commit will have bitmaps, the other will not
-- 
2.43.0

^ permalink raw reply related

* [PATCH 2/4] t5332: mark as leak-free
From: Rubén Justo @ 2024-01-29 21:08 UTC (permalink / raw)
  To: Git List
In-Reply-To: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>

This test is leak-free since it was added in af626ac0e0 (pack-bitmap:
enable reuse from all bitmapped packs, 2023-12-14).

Let's mark it as leak-free to make sure it stays that way (and to reduce
noise when looking for other leak-free scripts after we fix some leaks).

Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t5332-multi-pack-reuse.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh
index 2ba788b042..99145327a6 100755
--- a/t/t5332-multi-pack-reuse.sh
+++ b/t/t5332-multi-pack-reuse.sh
@@ -2,6 +2,7 @@
 
 test_description='pack-objects multi-pack reuse'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-bitmap.sh
 
-- 
2.43.0

^ permalink raw reply related

* [PATCH 1/4] t0080: mark as leak-free
From: Rubén Justo @ 2024-01-29 21:08 UTC (permalink / raw)
  To: Git List
In-Reply-To: <45eb0748-6415-4e52-a54f-8d4e5ad57dde@gmail.com>

This test is leak-free since it was added in e137fe3b29 (unit tests: add
TAP unit test framework, 2023-11-09)

Let's mark it as leak-free to make sure it stays that way (and to reduce
noise when looking for other leak-free scripts after we fix some leaks).

Signed-off-by: Rubén Justo <rjusto@gmail.com>
---
 t/t0080-unit-test-output.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t0080-unit-test-output.sh b/t/t0080-unit-test-output.sh
index 961b54b06c..6657c114a3 100755
--- a/t/t0080-unit-test-output.sh
+++ b/t/t0080-unit-test-output.sh
@@ -2,6 +2,7 @@
 
 test_description='Test the output of the unit test framework'
 
+TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
 
 test_expect_success 'TAP output from unit tests' '
-- 
2.43.0

^ permalink raw reply related

* [PATCH 0/4] mark tests as leak-free
From: Rubén Justo @ 2024-01-29 21:04 UTC (permalink / raw)
  To: Git List

The tests: t0080, t5332 and t6113 can be annotated as leak-free.

I used:
  $ make SANITIZE=leak GIT_TEST_PASSING_SANITIZE_LEAK=check GIT_TEST_SANITIZE_LEAK_LOG=true test

Rubén Justo (4):
  t0080: mark as leak-free
  t5332: mark as leak-free
  t6113: mark as leak-free
  test-lib: check for TEST_PASSES_SANITIZE_LEAK

 t/t0080-unit-test-output.sh        | 1 +
 t/t5332-multi-pack-reuse.sh        | 1 +
 t/t6113-rev-list-bitmap-filters.sh | 3 ++-
 t/test-lib.sh                      | 5 +++++
 4 files changed, 9 insertions(+), 1 deletion(-)

-- 
2.43.0

^ permalink raw reply

* Re: [PATCH v4 0/6] t: mark "files"-backend specific tests
From: Junio C Hamano @ 2024-01-29 20:38 UTC (permalink / raw)
  To: Christian Couder
  Cc: Patrick Steinhardt, git, Taylor Blau, Eric Sunshine, Toon Claes,
	Justin Tobler
In-Reply-To: <CAP8UFD3xWW-WvLPnHNVyJbbXDvs85TTq-wVVZ-qnJLSdqtR4bg@mail.gmail.com>

Christian Couder <christian.couder@gmail.com> writes:

> On Mon, Jan 29, 2024 at 12:07 PM Patrick Steinhardt <ps@pks.im> wrote:
>>
>> Hi,
>>
>> this is the fourth version of my patch series that addresses tests which
>> are specific to the "files" backend. There is only a single change
>> compared to v3, which is an improved commit message for the first patch.
>
> I took another look at the patches in this and it looks good to me
> now. Feel free to add my "Reviewed-by:"

Thanks.

^ permalink raw reply

* Re: [PATCH v3 0/4] for-each-ref: print all refs on empty string pattern
From: Junio C Hamano @ 2024-01-29 20:37 UTC (permalink / raw)
  To: Karthik Nayak; +Cc: git, ps, phillip.wood123
In-Reply-To: <20240129113527.607022-1-karthik.188@gmail.com>

Karthik Nayak <karthik.188@gmail.com> writes:

> This is the second version of my patch series to print refs
> when and empty string pattern is used with git-for-each-ref(1).

Thanks.  This is probably the third if I am counting correctly, and
the changes relative to the previous round match what I was
expecting to see.

Will queue.

^ permalink raw reply

* [PATCH 2/3] merge-ort.c: comment style fix
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw)
  To: git
In-Reply-To: <20240129202839.2234084-1-gitster@pobox.com>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 merge-ort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/merge-ort.c b/merge-ort.c
index 77ba7f3020..cb83449d7f 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -2641,7 +2641,7 @@ static void apply_directory_rename_modifications(struct merge_options *opt,
 			oidcpy(&ci->stages[i].oid, null_oid());
 		}
 
-		// Now we want to focus on new_ci, so reassign ci to it
+		/* Now we want to focus on new_ci, so reassign ci to it. */
 		ci = new_ci;
 	}
 
-- 
2.43.0-440-gb50a608ba2


^ permalink raw reply related

* [PATCH 3/3] reftable/pq_test: comment style fix
From: Junio C Hamano @ 2024-01-29 20:28 UTC (permalink / raw)
  To: git
In-Reply-To: <20240129202839.2234084-1-gitster@pobox.com>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 reftable/pq_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reftable/pq_test.c b/reftable/pq_test.c
index 011b5c7502..c202eff848 100644
--- a/reftable/pq_test.c
+++ b/reftable/pq_test.c
@@ -60,7 +60,7 @@ static void test_pq(void)
 		if (last) {
 			EXPECT(strcmp(last, rec->u.ref.refname) < 0);
 		}
-		// this is names[i], so don't dealloc.
+		/* this is names[i], so don't dealloc. */
 		last = rec->u.ref.refname;
 		rec->u.ref.refname = NULL;
 		reftable_record_release(rec);
-- 
2.43.0-440-gb50a608ba2


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox