Taylor Blau [Wed, 13 Jan 2021 22:25:02 +0000 (17:25 -0500)]
pack-revindex: remove unused 'find_revindex_position()'
Now that all 'find_revindex_position()' callers have been removed (and
converted to the more descriptive 'offset_to_pack_pos()'), it is almost
safe to get rid of 'find_revindex_position()' entirely. Almost, except
for the fact that 'offset_to_pack_pos()' calls
'find_revindex_position()'.
Inline 'find_revindex_position()' into 'offset_to_pack_pos()', and
then remove 'find_revindex_position()' entirely.
This is a straightforward refactoring with one minor snag.
'offset_to_pack_pos()' used to load the index before calling
'find_revindex_position()'. That means that by the time
'find_revindex_position()' starts executing, 'p->num_objects' can be
safely read. After inlining, be careful to not read 'p->num_objects'
until _after_ 'load_pack_revindex()' (which loads the index as a
side-effect) has been called.
Another small fix that is included is converting the upper- and
lower-bounds to be unsigned's instead of ints. This dates back to
92e5c77c37 (revindex: export new APIs, 2013-10-24)--ironically, the last
time we introduced new APIs here--but this unifies the types.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:58 +0000 (17:24 -0500)]
pack-revindex: remove unused 'find_pack_revindex()'
Now that no callers of 'find_pack_revindex()' remain, remove the
function's declaration and implementation entirely.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:54 +0000 (17:24 -0500)]
builtin/gc.c: guess the size of the revindex
'estimate_repack_memory()' takes into account the amount of memory
required to load the reverse index in memory by multiplying the assumed
number of objects by the size of the 'revindex_entry' struct.
Prepare for hiding the definition of 'struct revindex_entry' by removing
a 'sizeof()' of that type from outside of pack-revindex.c. Instead,
guess that one off_t and one uint32_t are required per object. Strictly
speaking, this is a worse guess than asking for 'sizeof(struct
revindex_entry)' directly, since the true size of this struct is 16
bytes with padding on the end of the struct in order to align the offset
field.
But, this is an approximation anyway, and it does remove a use of the
'struct revindex_entry' from outside of pack-revindex internals.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:49 +0000 (17:24 -0500)]
for_each_object_in_pack(): convert to new revindex API
Avoid looking at the 'revindex' pointer directly and instead call
'pack_pos_to_index()'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:45 +0000 (17:24 -0500)]
unpack_entry(): convert to new revindex API
Remove direct manipulation of the 'struct revindex_entry' type as well
as calls to the deprecated API in 'packfile.c:unpack_entry()'. Usual
clean-up is performed (replacing '->nr' with calls to
'pack_pos_to_index()' and so on).
Add an additional check to make sure that 'obj_offset()' points at a
valid object. In the case this check is violated, we cannot call
'mark_bad_packed_object()' because we don't know the OID. At the top of
the call stack is do_oid_object_info_extended() (via
packed_object_info()), which does mark the object.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:41 +0000 (17:24 -0500)]
packed_object_info(): convert to new revindex API
Convert another call of 'find_pack_revindex()' to its replacement
'pack_pos_to_offset()'. Likewise:
- Avoid manipulating `struct packed_git`'s `revindex` pointer directly
by removing the pointer-as-array indexing.
- Add an additional guard to check that the offset 'obj_offset()'
points to a real object. This should be the case with well-behaved
callers to 'packed_object_info()', but isn't guarenteed.
Other blocks that fill in various other values from the 'struct
object_info' request handle bad inputs by setting the type to
'OBJ_BAD' and jumping to 'out'. Do the same when given a bad offset
here.
The previous code would have segfaulted when given a bad
'obj_offset' value, since 'find_pack_revindex()' would return
'NULL', and then the line that fills 'oi->disk_sizep' would try to
access 'NULL[1]' with a stride of 16 bytes (the width of 'struct
revindex_entry)'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:36 +0000 (17:24 -0500)]
retry_bad_packed_offset(): convert to new revindex API
Perform exactly the same conversion as in the previous commit to another
caller within 'packfile.c'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:32 +0000 (17:24 -0500)]
get_delta_base_oid(): convert to new revindex API
Replace direct accesses to the 'struct revindex' type with a call to
'pack_pos_to_index()'.
Likewise drop the old-style 'find_pack_revindex()' with its replacement
'offset_to_pack_pos()' (while continuing to perform the same error
checking).
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:27 +0000 (17:24 -0500)]
rebuild_existing_bitmaps(): convert to new revindex API
Remove another instance of looking at the revindex directly by instead
calling 'pack_pos_to_index()'. Unlike other patches, this caller only
cares about the index position of each object in the loop.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:05 +0000 (17:24 -0500)]
try_partial_reuse(): convert to new revindex API
Remove another instance of direct revindex manipulation by calling
'pack_pos_to_offset()' instead (the caller here does not care about the
index position of the object at position 'pos').
Note that we cannot just use the existing "offset" variable to store the
value we get from pack_pos_to_offset(). It is incremented by
unpack_object_header(), but we later need the original value. Since
we'll no longer have revindex->offset to read it from, we'll store that
in a separate variable ("header" since it points to the entry's header
bytes).
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:24:00 +0000 (17:24 -0500)]
get_size_by_pos(): convert to new revindex API
Remove another caller that holds onto a 'struct revindex_entry' by
replacing the direct indexing with calls to 'pack_pos_to_offset()' and
'pack_pos_to_index()'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:56 +0000 (17:23 -0500)]
show_objects_for_type(): convert to new revindex API
Avoid storing the revindex entry directly, since this structure will
soon be removed from the public interface. Instead, store the offset and
index position by calling 'pack_pos_to_offset()' and
'pack_pos_to_index()', respectively.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:52 +0000 (17:23 -0500)]
bitmap_position_packfile(): convert to new revindex API
Replace find_revindex_position() with its counterpart in the new API,
offset_to_pack_pos().
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:47 +0000 (17:23 -0500)]
check_object(): convert to new revindex API
Replace direct accesses to the revindex with calls to
'offset_to_pack_pos()' and 'pack_pos_to_index()'.
Since this caller already had some error checking (it can jump to the
'give_up' label if it encounters an error), we can easily check whether
or not the provided offset points to an object in the given pack. This
error checking existed prior to this patch, too, since the caller checks
whether the return value from 'find_pack_revindex()' was NULL or not.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:43 +0000 (17:23 -0500)]
write_reused_pack_verbatim(): convert to new revindex API
Replace a direct access to the revindex array with
'pack_pos_to_offset()'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:39 +0000 (17:23 -0500)]
write_reused_pack_one(): convert to new revindex API
Replace direct revindex accesses with calls to 'pack_pos_to_offset()'
and 'pack_pos_to_index()'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:35 +0000 (17:23 -0500)]
write_reuse_object(): convert to new revindex API
First replace 'find_pack_revindex()' with its replacement
'offset_to_pack_pos()'. This prevents any bogus OFS_DELTA that may make
its way through until 'write_reuse_object()' from causing a bad memory
read (if 'revidx' is 'NULL')
Next, replace a direct access of '->nr' with the wrapper function
'pack_pos_to_index()'.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau [Wed, 13 Jan 2021 22:23:31 +0000 (17:23 -0500)]
pack-revindex: introduce a new API
In the next several patches, we will prepare for loading a reverse index
either in memory (mapping the inverse of the .idx's contents in-core),
or directly from a yet-to-be-introduced on-disk format. To prepare for
that, we'll introduce an API that avoids the caller explicitly indexing
the revindex pointer in the packed_git structure.
There are four ways to interact with the reverse index. Accordingly,
four functions will be exported from 'pack-revindex.h' by the time that
the existing API is removed. A caller may:
1. Load the pack's reverse index. This involves opening up the index,
generating an array, and then sorting it. Since opening the index
can fail, this function ('load_pack_revindex()') returns an int.
Accordingly, it takes only a single argument: the 'struct
packed_git' the caller wants to build a reverse index for.
This function is well-suited for both the current and new API.
Callers will have to continue to open the reverse index explicitly,
but this function will eventually learn how to detect and load a
reverse index from the on-disk format, if one exists. Otherwise, it
will fallback to generating one in memory from scratch.
2. Convert a pack position into an offset. This operation is now
called `pack_pos_to_offset()`. It takes a pack and a position, and
returns the corresponding off_t.
Any error simply calls BUG(), since the callers are not well-suited
to handle a failure and keep going.
3. Convert a pack position into an index position. Same as above; this
takes a pack and a position, and returns a uint32_t. This operation
is known as `pack_pos_to_index()`. The same thinking about error
conditions applies here as well.
4. Find the pack position for a given offset. This operation is now
known as `offset_to_pack_pos()`. It takes a pack, an offset, and a
pointer to a uint32_t where the position is written, if an object
exists at that offset. Otherwise, -1 is returned to indicate
failure.
Unlike some of the callers that used to access '->offset' and '->nr'
directly, the error checking around this call is somewhat more
robust. This is important since callers should always pass an offset
which points at the boundary of two objects. The API, unlike direct
access, enforces that that is the case.
This will become important in a subsequent patch where a caller
which does not but could check the return value treats the signed
`-1` from `find_revindex_position()` as an index into the 'revindex'
array.
Two design warts are carried over into the new API:
- Asking for the index position of an out-of-bounds object will result
in a BUG() (since no such object exists), but asking for the offset
of the non-existent object at the end of the pack returns the total
size of the pack.
This makes it convenient for callers who always want to take the
difference of two adjacent object's offsets (to compute the on-disk
size) but don't want to worry about boundaries at the end of the
pack.
- offset_to_pack_pos() lazily loads the reverse index, but
pack_pos_to_index() doesn't (callers of the former are well-suited
to handle errors, but callers of the latter are not).
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 7 Jan 2021 07:22:15 +0000 (23:22 -0800)]
The first batch in 2.31 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'es/perf-export-fix'
Tweak unneeded recursion from a test framework helper function.
* es/perf-export-fix:
t/perf: avoid unnecessary test_export() recursion
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'fc/t6030-bisect-reset-removes-auxiliary-files'
A 3-year old test that was not testing anything useful has been
corrected.
* fc/t6030-bisect-reset-removes-auxiliary-files:
test: bisect-porcelain: fix location of files
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'es/worktree-repair-both-moved'
"git worktree repair" learned to deal with the case where both the
repository and the worktree moved.
* es/worktree-repair-both-moved:
worktree: teach `repair` to fix multi-directional breakage
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'en/merge-ort-recursive'
The ORT merge strategy learned to synthesize virtual ancestor tree
by recursively merging multiple merge bases together, just like the
recursive backend has done for years.
* en/merge-ort-recursive:
merge-ort: implement merge_incore_recursive()
merge-ort: make clear_internal_opts() aware of partial clearing
merge-ort: copy a few small helper functions from merge-recursive.c
commit: move reverse_commit_list() from merge-recursive
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'fc/pull-merge-rebase'
When a user does not tell "git pull" to use rebase or merge, the
command gives a loud message telling a user to choose between
rebase or merge but creates a merge anyway, forcing users who would
want to rebase to redo the operation. Fix an early part of this
problem by tightening the condition to give the message---there is
no reason to stop or force the user to choose between rebase or
merge if the history fast-forwards.
* fc/pull-merge-rebase:
pull: display default warning only when non-ff
pull: correct condition to trigger non-ff advice
pull: get rid of unnecessary global variable
pull: give the advice for choosing rebase/merge much later
pull: refactor fast-forward check
Junio C Hamano [Thu, 7 Jan 2021 07:33:44 +0000 (23:33 -0800)]
Merge branch 'en/merge-ort-2'
More "ORT" merge strategy.
* en/merge-ort-2:
merge-ort: add modify/delete handling and delayed output processing
merge-ort: add die-not-implemented stub handle_content_merge() function
merge-ort: add function grouping comments
merge-ort: add a paths_to_free field to merge_options_internal
merge-ort: add a path_conflict field to merge_options_internal
merge-ort: add a clear_internal_opts helper
merge-ort: add a few includes
Junio C Hamano [Thu, 7 Jan 2021 07:33:43 +0000 (23:33 -0800)]
Merge branch 'en/merge-ort-impl'
The merge backend "done right" starts to emerge.
* en/merge-ort-impl:
merge-ort: free data structures in merge_finalize()
merge-ort: add implementation of record_conflicted_index_entries()
tree: enable cmp_cache_name_compare() to be used elsewhere
merge-ort: add implementation of checkout()
merge-ort: basic outline for merge_switch_to_result()
merge-ort: step 3 of tree writing -- handling subdirectories as we go
merge-ort: step 2 of tree writing -- function to create tree object
merge-ort: step 1 of tree writing -- record basenames, modes, and oids
merge-ort: have process_entries operate in a defined order
merge-ort: add a preliminary simple process_entries() implementation
merge-ort: avoid recursing into identical trees
merge-ort: record stage and auxiliary info for every path
merge-ort: compute a few more useful fields for collect_merge_info
merge-ort: avoid repeating fill_tree_descriptor() on the same tree
merge-ort: implement a very basic collect_merge_info()
merge-ort: add an err() function similar to one from merge-recursive
merge-ort: use histogram diff
merge-ort: port merge_start() from merge-recursive
merge-ort: add some high-level algorithm structure
merge-ort: setup basic internal data structures
Junio C Hamano [Thu, 7 Jan 2021 07:33:43 +0000 (23:33 -0800)]
Merge branch 'tb/pack-bitmap'
Various improvements to the codepath that writes out pack bitmaps.
* tb/pack-bitmap: (24 commits)
pack-bitmap-write: better reuse bitmaps
pack-bitmap-write: relax unique revwalk condition
pack-bitmap-write: use existing bitmaps
pack-bitmap: factor out 'add_commit_to_bitmap()'
pack-bitmap: factor out 'bitmap_for_commit()'
pack-bitmap-write: ignore BITMAP_FLAG_REUSE
pack-bitmap-write: build fewer intermediate bitmaps
pack-bitmap.c: check reads more aggressively when loading
pack-bitmap-write: rename children to reverse_edges
t5310: add branch-based checks
commit: implement commit_list_contains()
bitmap: implement bitmap_is_subset()
pack-bitmap-write: fill bitmap with commit history
pack-bitmap-write: pass ownership of intermediate bitmaps
pack-bitmap-write: reimplement bitmap writing
ewah: add bitmap_dup() function
ewah: implement bitmap_or()
ewah: make bitmap growth less aggressive
ewah: factor out bitmap growth
rev-list: die when --test-bitmap detects a mismatch
...
Junio C Hamano [Thu, 7 Jan 2021 07:33:43 +0000 (23:33 -0800)]
Merge branch 'ab/trailers-extra-format'
The "--format=%(trailers)" mechanism gets enhanced to make it
easier to design output for machine consumption.
* ab/trailers-extra-format:
pretty format %(trailers): add a "key_value_separator"
pretty format %(trailers): add a "keyonly"
pretty-format %(trailers): fix broken standalone "valueonly"
pretty format %(trailers) doc: avoid repetition
pretty format %(trailers) test: split a long line
Junio C Hamano [Thu, 7 Jan 2021 07:33:43 +0000 (23:33 -0800)]
Merge branch 'pk/subsub-fetch-fix-take-2'
"git fetch --recurse-submodules" fix (second attempt).
* pk/subsub-fetch-fix-take-2:
submodules: fix of regression on fetching of non-init subsub-repo
Junio C Hamano [Sun, 27 Dec 2020 23:15:23 +0000 (15:15 -0800)]
Git 2.30
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Sun, 27 Dec 2020 23:14:31 +0000 (15:14 -0800)]
Merge branch 'pb/doc-git-linkit-fix'
Docfix.
* pb/doc-git-linkit-fix:
git.txt: fix typos in 'linkgit' macro invocation
Junio C Hamano [Sun, 27 Dec 2020 23:01:16 +0000 (15:01 -0800)]
Merge tag 'l10n-2.30.0-rnd2' of https://github.com/git-l10n/git-po
l10n for Git 2.30.0 round 2
* tag 'l10n-2.30.0-rnd2' of https://github.com/git-l10n/git-po:
l10n: zh_CN: for git v2.30.0 l10n round 1 and 2
l10n: zh_TW.po: v2.30.0 round 2 (1 untranslated)
l10n: pl.po: add translation and set team leader
l10n: pl.po: started Polish translation
l10n: de.po: Update German translation for Git 2.30.0
l10n: Update Catalan translation
l10n: bg.po: Updated Bulgarian translation (5037t)
l10n: fr.po v2.30.0 rnd 2
l10n: tr: v2.30.0-r2
l10n: sv.po: Update Swedish translation (5037t0f0u)
l10n: vi.po(5037t): v2.30.0 rnd 2
l10n: git.pot: v2.30.0 round 2 (1 new, 2 removed)
l10n: Update Catalan translation
l10n: fr.po: v2.30.0 rnd 1
l10n: fr.po Fix a typo
l10n: fr fix misleading message
l10n: tr: v2.30.0-r1
l10n: sv.po: Update Swedish translation (5038t0f0u)
l10n: git.pot: v2.30.0 round 1 (70 new, 45 removed)
Jiang Xin [Mon, 7 Dec 2020 00:10:10 +0000 (08:10 +0800)]
l10n: zh_CN: for git v2.30.0 l10n round 1 and 2
Translate 71 new messages (5037t0f0u) for git 2.30.0.
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Fri, 25 Dec 2020 07:12:02 +0000 (15:12 +0800)]
Merge branch 'l10n/zh_TW/201223' of github.com:l10n-tw/git-po
* 'l10n/zh_TW/201223' of github.com:l10n-tw/git-po:
l10n: zh_TW.po: v2.30.0 round 2 (1 untranslated)
pan93412 [Wed, 23 Dec 2020 13:52:18 +0000 (21:52 +0800)]
l10n: zh_TW.po: v2.30.0 round 2 (1 untranslated)
Signed-off-by: pan93412 <pan93412@gmail.com>
Arusekk [Wed, 2 Dec 2020 23:19:58 +0000 (00:19 +0100)]
l10n: pl.po: add translation and set team leader
Signed-off-by: Arusekk <arek_koz@o2.pl>
Junio C Hamano [Wed, 23 Dec 2020 21:57:41 +0000 (13:57 -0800)]
Git 2.30-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 23 Dec 2020 21:59:46 +0000 (13:59 -0800)]
Merge branch 'nk/refspecs-negative-fix'
Hotfix for recent regression.
* nk/refspecs-negative-fix:
negative-refspec: improve comment on query_matches_negative_refspec
negative-refspec: fix segfault on : refspec
Junio C Hamano [Wed, 23 Dec 2020 21:59:46 +0000 (13:59 -0800)]
Merge branch 'ma/maintenance-crontab-fix'
Hotfix for a topic of this cycle.
* ma/maintenance-crontab-fix:
t7900-maintenance: test for magic markers
gc: fix handling of crontab magic markers
git-maintenance.txt: add missing word
Junio C Hamano [Wed, 23 Dec 2020 21:59:46 +0000 (13:59 -0800)]
Merge branch 'dl/checkout-p-merge-base'
Fix to a regression introduced during this cycle.
* dl/checkout-p-merge-base:
checkout -p: handle tree arguments correctly again
Junio C Hamano [Wed, 23 Dec 2020 21:59:46 +0000 (13:59 -0800)]
Merge branch 'js/no-more-prepare-for-main-in-test'
Test coverage fix.
* js/no-more-prepare-for-main-in-test:
tests: drop the `PREPARE_FOR_MAIN_BRANCH` prereq
t9902: use `main` as initial branch name
t6302: use `main` as initial branch name
t5703: use `main` as initial branch name
t5510: use `main` as initial branch name
t5505: finalize transitioning to using the branch name `main`
t3205: finalize transitioning to using the branch name `main`
t3203: complete the transition to using the branch name `main`
t3201: finalize transitioning to using the branch name `main`
t3200: finish transitioning to the initial branch name `main`
t1400: use `main` as initial branch name
Junio C Hamano [Wed, 23 Dec 2020 21:59:46 +0000 (13:59 -0800)]
Merge branch 'jx/pack-redundant-on-single-pack'
"git pack-redandant" when there is only one packfile used to crash,
which has been corrected.
* jx/pack-redundant-on-single-pack:
pack-redundant: fix crash when one packfile in repo
m4sk1n [Mon, 16 Jan 2017 19:31:10 +0000 (20:31 +0100)]
l10n: pl.po: started Polish translation
Signed-off-by: Arusekk <arek_koz@o2.pl>
Matthias Rüster [Sat, 19 Dec 2020 12:53:23 +0000 (13:53 +0100)]
l10n: de.po: Update German translation for Git 2.30.0
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Jiang Xin [Wed, 23 Dec 2020 00:44:44 +0000 (08:44 +0800)]
Merge branch 'master' of github.com:Softcatala/git-po
* 'master' of github.com:Softcatala/git-po:
l10n: Update Catalan translation
Eric Sunshine [Sun, 20 Dec 2020 21:27:40 +0000 (16:27 -0500)]
t/perf: avoid unnecessary test_export() recursion
test_export() has been self-recursive since its inception even though a
simple for-loop would have served just as well to append its arguments
to the `test_export_` variable separated by the pipe character "|".
Recently `test_export_` was changed instead to a space-separated list of
tokens to be exported, an operation which can be accomplished via a
single simple assignment, with no need for looping or recursion.
Therefore, simplify the implementation.
While at it, take advantage of the fact that variable names to be
exported are shell identifiers, thus won't be composed of special
characters or whitespace, thus simple a `$*` can be used rather than
magical `"$@"`.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Blain [Tue, 22 Dec 2020 15:44:42 +0000 (15:44 +0000)]
git.txt: fix typos in 'linkgit' macro invocation
The 'linkgit' Asciidoc macro is misspelled as 'linkit' in the
description of 'GIT_SEQUENCE_EDITOR' since the addition of that variable
to git(1) in
902a126eca (doc: mention GIT_SEQUENCE_EDITOR and
'sequence.editor' more, 2020-08-31). Also, it uses two colons instead of
one.
Fix that.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jordi Mas [Tue, 22 Dec 2020 17:04:53 +0000 (18:04 +0100)]
l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
Alexander Shopov [Sun, 20 Dec 2020 18:00:54 +0000 (19:00 +0100)]
l10n: bg.po: Updated Bulgarian translation (5037t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Nipunn Koorapati [Tue, 22 Dec 2020 03:58:17 +0000 (03:58 +0000)]
negative-refspec: improve comment on query_matches_negative_refspec
Comment did not adequately explain how the two loops work
together to achieve the goal of querying for matching of any
negative refspec.
Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nipunn Koorapati [Tue, 22 Dec 2020 03:58:16 +0000 (03:58 +0000)]
negative-refspec: fix segfault on : refspec
The logic added to check for negative pathspec match by
c0192df630
(refspec: add support for negative refspecs, 2020-09-30) looks at
refspec->src assuming it is never NULL, however when
remote.origin.push is set to ":", then refspec->src is NULL,
causing a segfault within strcmp.
Tell git to handle matching refspec by adding the needle to the
set of positively matched refspecs, since matching ":" refspecs
match anything as src.
Add test for matching refspec pushes fetch-negative-refspec
both individually and in combination with a negative refspec.
Signed-off-by: Nipunn Koorapati <nipunn@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Tue, 22 Dec 2020 00:46:17 +0000 (08:46 +0800)]
Merge branch 'fr_2.30_rnd2' of github.com:jnavila/git
* 'fr_2.30_rnd2' of github.com:jnavila/git:
l10n: fr.po v2.30.0 rnd 2
Martin Ågren [Mon, 21 Dec 2020 21:26:33 +0000 (22:26 +0100)]
t7900-maintenance: test for magic markers
When we insert our "BEGIN" and "END" markers into the cron table, it's
so that a Git version from many years into the future would be able to
identify this region in the cron table. Let's add a test to make sure
that these markers don't ever change.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin Ågren [Mon, 21 Dec 2020 21:26:32 +0000 (22:26 +0100)]
gc: fix handling of crontab magic markers
On `git maintenance start`, we add a few entries to the user's cron
table. We wrap our entries using two magic markers, "# BEGIN GIT
MAINTENANCE SCHEDULE" and "# END GIT MAINTENANCE SCHEDULE". At a later
`git maintenance stop`, we will go through the table and remove these
lines. Or rather, we will remove the "BEGIN" marker, the "END" marker
and everything between them.
Alas, we have a bug in how we detect the "END" marker: we don't. As we
loop through all the lines of the crontab, if we are in the "old
region", i.e., the region we're aiming to remove, we make an early
`continue` and don't get as far as checking for the "END" marker. Thus,
once we've seen our "BEGIN", we remove everything until the end of the
file.
Rewrite the logic for identifying these markers. There are four cases
that are mutually exclusive: The current line starts a region or it ends
it, or it's firmly within the region, or it's outside of it (and should
be printed).
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin Ågren [Mon, 21 Dec 2020 21:26:31 +0000 (22:26 +0100)]
git-maintenance.txt: add missing word
Add a missing "a" before "bunch".
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Sat, 19 Dec 2020 14:55:59 +0000 (14:55 +0000)]
checkout -p: handle tree arguments correctly again
This fixes a segmentation fault.
The bug is caused by dereferencing `new_branch_info->commit` when it is
`NULL`, which is the case when the tree-ish argument is actually a tree,
not a commit-ish. This was introduced in
5602b500c3c (builtin/checkout:
fix `git checkout -p HEAD...` bug, 2020-10-07), where we tried to ensure
that the special tree-ish `HEAD...` is handled correctly.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Mon, 21 Dec 2020 08:16:01 +0000 (03:16 -0500)]
worktree: teach `repair` to fix multi-directional breakage
`git worktree repair` knows how to repair the two-way links between the
repository and a worktree as long as a link in one or the other
direction is sound. For instance, if a linked worktree is moved (without
using `git worktree move`), repair is possible because the worktree
still knows the location of the repository even though the repository no
longer knows where the worktree is. Similarly, if the repository is
moved, repair is possible since the repository still knows the locations
of the worktrees even though the worktrees no longer know where the
repository is.
However, if both the repository and the worktrees are moved, then links
are severed in both directions, and no repair is possible. This is the
case even when the new worktree locations are specified as arguments to
`git worktree repair`. The reason for this limitation is twofold. First,
when `repair` consults the worktree's gitfile (/path/to/worktree/.git)
to determine the corresponding <repo>/worktrees/<id>/gitdir file to fix,
<repo> is the old path to the repository, thus it is unable to fix the
`gitdir` file at its new location since it doesn't know where it is.
Second, when `repair` consults <repo>/worktrees/<id>/gitdir to find the
location of the worktree's gitfile (/path/to/worktree/.git), the path
recorded in `gitdir` is the old location of the worktree's gitfile, thus
it is unable to repair the gitfile since it doesn't know where it is.
Fix these shortcomings by teaching `repair` to attempt to infer the new
location of the <repo>/worktrees/<id>/gitdir file when the location
recorded in the worktree's gitfile has become stale but the file is
otherwise well-formed. The inference is intentionally simple-minded.
For each worktree path specified as an argument, `git worktree repair`
manually reads the ".git" gitfile at that location and, if it is
well-formed, extracts the <id>. It then searches for a corresponding
<id> in <repo>/worktrees/ and, if found, concludes that there is a
reasonable match and updates <repo>/worktrees/<id>/gitdir to point at
the specified worktree path. In order for <repo> to be known, `git
worktree repair` must be run in the main worktree or bare repository.
`git worktree repair` first attempts to repair each incoming
/path/to/worktree/.git gitfile to point at the repository, and then
attempts to repair outgoing <repo>/worktrees/<id>/gitdir files to point
at the worktrees. This sequence was chosen arbitrarily when originally
implemented since the order of fixes is immaterial as long as one side
of the two-way link between the repository and a worktree is sound.
However, for this new repair technique to work, the order must be
reversed. This is because the new inference mechanism, when it is
successful, allows the outgoing <repo>/worktrees/<id>/gitdir file to be
repaired, thus fixing one side of the two-way link. Once that side is
fixed, the other side can be fixed by the existing repair mechanism,
hence the order of repairs is now significant.
Two safeguards are employed to avoid hijacking a worktree from a
different repository if the user accidentally specifies a foreign
worktree as an argument. The first, as described above, is that it
requires an <id> match between the repository and the worktree. That
itself is not foolproof for preventing hijack, so the second safeguard
is that the inference will only kick in if the worktree's
/path/to/worktree/.git gitfile does not point at a repository.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Contreras [Fri, 18 Dec 2020 15:14:06 +0000 (09:14 -0600)]
test: bisect-porcelain: fix location of files
Commit
ba7eafe146 (t6030: explicitly test for bisection cleanup,
2017-09-29) introduced checks for files in the $GIT_DIR directory, but
that variable is not always defined, and in this test file it's not.
Therefore these checks always passed regardless of the presence of these
files (unless the user has some /BISECT_LOG file, for some reason).
Let's check the files in the correct location.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jean-Noël Avila [Mon, 21 Dec 2020 17:53:19 +0000 (18:53 +0100)]
l10n: fr.po v2.30.0 rnd 2
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Emir Sarı [Mon, 21 Dec 2020 09:32:52 +0000 (12:32 +0300)]
l10n: tr: v2.30.0-r2
Signed-off-by: Emir Sarı <bitigchi@me.com>
Peter Krefting [Mon, 21 Dec 2020 07:10:43 +0000 (08:10 +0100)]
l10n: sv.po: Update Swedish translation (5037t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Tran Ngoc Quan [Mon, 21 Dec 2020 01:45:38 +0000 (08:45 +0700)]
l10n: vi.po(5037t): v2.30.0 rnd 2
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
Jiang Xin [Sun, 20 Dec 2020 23:11:59 +0000 (07:11 +0800)]
l10n: git.pot: v2.30.0 round 2 (1 new, 2 removed)
Generate po/git.pot from v2.30.0-rc1 for git v2.30.0 l10n round 2.
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Jiang Xin [Sun, 20 Dec 2020 23:10:19 +0000 (07:10 +0800)]
Merge remote-tracking branch 'github/master' into git-po-master
* github/master: (42 commits)
Git 2.30-rc1
git-gui: use gray background for inactive text widgets
Another batch before 2.30-rc1
git-gui: Fix selected text colors
Makefile: conditionally include GIT-VERSION-FILE
git-gui: fix colored label backgrounds when using themed widgets
config.mak.uname: remove old NonStop compatibility settings
diff: correct interaction between --exit-code and -I<pattern>
t/perf: fix test_export() failure with BSD `sed`
style: do not "break" in switch() after "return"
compat-util: pretend that stub setitimer() always succeeds
strmap: make callers of strmap_remove() to call it in void context
doc: mention Python 3.x supports
index-format.txt: document v2 format of file system monitor extension
docs: multi-pack-index: remove note about future 'verify' work
init: provide useful advice about init.defaultBranch
get_default_branch_name(): prepare for showing some advice
branch -m: allow renaming a yet-unborn branch
init: document `init.defaultBranch` better
t7900: use --fixed-value in git-maintenance tests
...
Jordi Mas [Sat, 19 Dec 2020 22:52:12 +0000 (23:52 +0100)]
l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
Junio C Hamano [Fri, 18 Dec 2020 23:14:30 +0000 (15:14 -0800)]
Git 2.30-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 18 Dec 2020 23:15:18 +0000 (15:15 -0800)]
Merge branch 'jc/diff-I-status-fix'
"git diff -I<pattern> -exit-code" should exit with 0 status when
all the changes match the ignored pattern, but it didn't.
* jc/diff-I-status-fix:
diff: correct interaction between --exit-code and -I<pattern>
Junio C Hamano [Fri, 18 Dec 2020 23:15:18 +0000 (15:15 -0800)]
Merge branch 'es/perf-export-fix'
Dev-support fix for BSD.
* es/perf-export-fix:
t/perf: fix test_export() failure with BSD `sed`
Junio C Hamano [Fri, 18 Dec 2020 23:15:18 +0000 (15:15 -0800)]
Merge branch 'rb/nonstop-config-mak-uname-update'
Build update.
* rb/nonstop-config-mak-uname-update:
config.mak.uname: remove old NonStop compatibility settings
Junio C Hamano [Fri, 18 Dec 2020 23:15:17 +0000 (15:15 -0800)]
Merge branch 'ab/unreachable-break'
Code clean-up.
* ab/unreachable-break:
style: do not "break" in switch() after "return"
Junio C Hamano [Fri, 18 Dec 2020 23:15:17 +0000 (15:15 -0800)]
Merge branch 'jc/strmap-remove-typefix'
C-std compliance fix.
* jc/strmap-remove-typefix:
strmap: make callers of strmap_remove() to call it in void context
Junio C Hamano [Fri, 18 Dec 2020 23:15:17 +0000 (15:15 -0800)]
Merge branch 'jc/compat-util-setitimer-fix'
Fix a recent bug in a rarely used replacement code.
* jc/compat-util-setitimer-fix:
compat-util: pretend that stub setitimer() always succeeds
Junio C Hamano [Fri, 18 Dec 2020 23:15:17 +0000 (15:15 -0800)]
Merge branch 'dd/doc-p4-requirements-update'
Doc update.
* dd/doc-p4-requirements-update:
doc: mention Python 3.x supports
Junio C Hamano [Fri, 18 Dec 2020 23:15:17 +0000 (15:15 -0800)]
Merge branch 'js/init-defaultbranch-advice'
Our users are going to be trained to prepare for future change of
init.defaultBranch configuration variable.
* js/init-defaultbranch-advice:
init: provide useful advice about init.defaultBranch
get_default_branch_name(): prepare for showing some advice
branch -m: allow renaming a yet-unborn branch
init: document `init.defaultBranch` better
Junio C Hamano [Fri, 18 Dec 2020 23:07:10 +0000 (15:07 -0800)]
Merge https://github.com/prati0100/git-gui
* https://github.com/prati0100/git-gui:
git-gui: use gray background for inactive text widgets
git-gui: Fix selected text colors
Makefile: conditionally include GIT-VERSION-FILE
git-gui: fix colored label backgrounds when using themed widgets
git-gui: ssh-askpass: add a checkbox to show the input text
git-gui: update Russian translation
git-gui: use commit message template
git-gui: Only touch GITGUI_MSG when needed
Pratyush Yadav [Fri, 18 Dec 2020 19:32:34 +0000 (01:02 +0530)]
Merge branch 'sh/inactive-background'
Set a different background color for selections in inactive widgets.
This inactive color is calculated from the current theme colors to make
sure it works for all themes.
* sh/inactive-background:
git-gui: use gray background for inactive text widgets
Stefan Haller [Fri, 18 Dec 2020 09:43:14 +0000 (10:43 +0100)]
git-gui: use gray background for inactive text widgets
This makes it easier to see at a glance which of the four main views has the
keyboard focus.
Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Junio C Hamano [Thu, 17 Dec 2020 23:04:26 +0000 (15:04 -0800)]
Another batch before 2.30-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Thu, 17 Dec 2020 23:06:42 +0000 (15:06 -0800)]
Merge branch 'jh/index-v2-doc-on-fsmn'
Doc update.
* jh/index-v2-doc-on-fsmn:
index-format.txt: document v2 format of file system monitor extension
Junio C Hamano [Thu, 17 Dec 2020 23:06:41 +0000 (15:06 -0800)]
Merge branch 'jb/midx-doc-update'
Doc update.
* jb/midx-doc-update:
docs: multi-pack-index: remove note about future 'verify' work
Junio C Hamano [Thu, 17 Dec 2020 23:06:40 +0000 (15:06 -0800)]
Merge branch 'rj/make-clean'
Build optimization.
* rj/make-clean:
Makefile: don't use a versioned temp distribution directory
Makefile: don't try to clean old debian build product
gitweb/Makefile: conditionally include ../GIT-VERSION-FILE
Documentation/Makefile: conditionally include ../GIT-VERSION-FILE
Documentation/Makefile: conditionally include doc.dep
Junio C Hamano [Thu, 17 Dec 2020 23:06:40 +0000 (15:06 -0800)]
Merge branch 'js/t7064-master-to-initial'
Test update.
* js/t7064-master-to-initial:
t7064: avoid relying on a specific default branch name
Junio C Hamano [Thu, 17 Dec 2020 23:06:40 +0000 (15:06 -0800)]
Merge branch 'js/t6300-hardcode-main'
Test update.
* js/t6300-hardcode-main:
t6300: avoid using the default name of the initial branch
Junio C Hamano [Thu, 17 Dec 2020 23:06:40 +0000 (15:06 -0800)]
Merge branch 'jk/oid-array-cleanup'
Code clean-up.
* jk/oid-array-cleanup:
commit-graph: use size_t for array allocation and indexing
commit-graph: replace packed_oid_list with oid_array
commit-graph: drop count_distinct_commits() function
oid-array: provide a for-loop iterator
oid-array: make sort function public
cache.h: move hash/oid functions to hash.h
t0064: make duplicate tests more robust
t0064: drop sha1 mention from filename
oid-array.h: drop sha1 mention from header guard
Junio C Hamano [Thu, 17 Dec 2020 23:06:40 +0000 (15:06 -0800)]
Merge branch 'tb/partial-clone-filters-fix'
Fix potential server side resource deallocation issues when
responding to a partial clone request.
* tb/partial-clone-filters-fix:
upload-pack.c: don't free allowed_filters util pointers
builtin/clone.c: don't ignore transport_fetch_refs() errors
Junio C Hamano [Thu, 17 Dec 2020 23:06:39 +0000 (15:06 -0800)]
Merge branch 'js/t7900-protect-pwd-in-config-get'
Hotfix for test breakage.
* js/t7900-protect-pwd-in-config-get:
t7900: use --fixed-value in git-maintenance tests
Pratyush Yadav [Thu, 17 Dec 2020 20:22:26 +0000 (01:52 +0530)]
Merge branch 'st/selected-text-colors'
Set colors for selected text properly.
* st/selected-text-colors:
git-gui: Fix selected text colors
Serg Tereshchenko [Sun, 22 Nov 2020 13:32:33 +0000 (15:32 +0200)]
git-gui: Fix selected text colors
Added selected state colors for text widget.
Same colors for active and inactive selection, to match previous
behaviour.
Signed-off-by: Serg Tereshchenko <serg.partizan@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Pratyush Yadav [Thu, 17 Dec 2020 19:12:14 +0000 (00:42 +0530)]
Merge branch 'rj/clean-speedup'
Speed up 'make clean' on Cygwin.
* rj/clean-speedup:
Makefile: conditionally include GIT-VERSION-FILE
Ramsay Jones [Mon, 7 Dec 2020 00:39:30 +0000 (00:39 +0000)]
Makefile: conditionally include GIT-VERSION-FILE
The 'clean' target is noticeably slow on cygwin, even for a 'do-nothing'
invocation of 'make clean'. For example, the second 'make clean' given
below:
$ make clean >/dev/null 2>&1
$ make clean
GITGUI_VERSION = 0.21.0.85.g3e5c
rm -rf git-gui lib/tclIndex po/*.msg
rm -rf GIT-VERSION-FILE GIT-GUI-VARS
$
has been timed at 1.934s on my laptop (an old core i5-4200M @ 2.50GHz,
8GB RAM, 1TB HDD).
Notice that the Makefile, as part of processing the 'clean' target, is
updating the 'GIT-VERSION-FILE' file. This is to ensure that the
$(GITGUI_VERSION) make variable is set, once that file had been included.
However, the 'clean' target does not use the $(GITGUI_VERSION) variable,
so this is wasted effort.
In order to eliminate such wasted effort, use the value of the internal
$(MAKECMDGOALS) variable to only '-include GIT-VERSION-FILE' when the
target is not 'clean'. (This drops the time down to 0.676s, on my laptop,
giving an improvement of 65.05%).
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Pratyush Yadav [Thu, 17 Dec 2020 19:02:06 +0000 (00:32 +0530)]
Merge branch 'sh/macos-labels'
Fix label background colors on MacOS when ttk is enabled.
* sh/macos-labels:
git-gui: fix colored label backgrounds when using themed widgets
Stefan Haller [Sun, 22 Nov 2020 19:45:37 +0000 (20:45 +0100)]
git-gui: fix colored label backgrounds when using themed widgets
The aqua theme on Mac doesn't support changing the background color for labels
and frames [1]. Since the red, green, and yellow backgrounds of the labels for
unstaged and staged files and the diff pane are so important design elements of
git gui's main window, it's not acceptable for them to have grey backgrounds on
Mac.
To work around this, simply use non-themed widgets for all labels on Mac. This
is not a big problem because labels don't look extremely different between the
themed and non-themed versions. There are subtle differences, but they are not
as bad as having the wrong background color.
[1] https://stackoverflow.com/a/
6723911
Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Randall S. Becker [Wed, 16 Dec 2020 22:07:52 +0000 (17:07 -0500)]
config.mak.uname: remove old NonStop compatibility settings
The MKDIR_WO_TRAILING_SLASH and NO_SETITIMER options are no longer
needed on the NonStop platforms as both are now supported by the
oldest supported operating system revision.
Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Wed, 16 Dec 2020 22:28:02 +0000 (22:28 +0000)]
merge-ort: implement merge_incore_recursive()
Implement merge_incore_recursive(), mostly through the use of a new
helper function, merge_ort_internal(), which itself is based off
merge_recursive_internal() from merge-recursive.c.
This drops the number of failures in the testsuite when run under
GIT_TEST_MERGE_ALGORITHM=ort from around 1500 to 647.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Wed, 16 Dec 2020 22:28:01 +0000 (22:28 +0000)]
merge-ort: make clear_internal_opts() aware of partial clearing
In order to handle recursive merges, after merging merge-bases we need
to clear away most of the data we had built up but some of it needs to
be kept -- in particular the "output" field. Rename the function to
reflect its future change in use.
Further, since "reinitialize" means we'll be reusing the fields
immediately, take advantage of this to only partially clear maps,
leaving the hashtable allocated and pre-sized. (This may be slightly
out-of-order since the speedups aren't realized until there are far
more strmaps in use, but the patch submission process already went out
of order because of various questions and requests for strmap. Anyway,
see commit
6ccdfc2a20 ("strmap: enable faster clearing and reusing of
strmaps", 2020-11-05), for performance details about the use of
strmap_partial_clear().)
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Wed, 16 Dec 2020 22:28:00 +0000 (22:28 +0000)]
merge-ort: copy a few small helper functions from merge-recursive.c
In a subsequent commit, we will implement the traditional recursiveness
that gave merge-recursive its name, namely merging non-unique
merge-bases to come up with a single virtual merge base. Copy a few
helper functions from merge-recursive.c that we will use in the
implementation.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren [Wed, 16 Dec 2020 22:27:59 +0000 (22:27 +0000)]
commit: move reverse_commit_list() from merge-recursive
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jiang Xin [Thu, 17 Dec 2020 01:57:09 +0000 (20:57 -0500)]
pack-redundant: fix crash when one packfile in repo
Command `git pack-redundant --all` will crash if there is only one
packfile in the repository. This is because, if there is only one
packfile in local_packs, `cmp_local_packs` will do nothing and will
leave `pl->unique_objects` as uninitialized.
Also add testcases for repository with no packfile and one packfile
in t5323.
Reported-by: Daniel C. Klauer <daniel.c.klauer@web.de>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Thu, 17 Dec 2020 01:07:10 +0000 (01:07 +0000)]
tests: drop the `PREPARE_FOR_MAIN_BRANCH` prereq
We no longer use it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin [Thu, 17 Dec 2020 01:07:09 +0000 (01:07 +0000)]
t9902: use `main` as initial branch name
In
8164360fc86 (t9902: prepare a test for the upcoming default branch
name, 2020-10-23), we started adjusting this test script for the default
initial branch name changing to `main`.
However, there is no need to wait for that: let's adjust the test script
to stop relying on a specific initial branch name by setting it
explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq
from one test case.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>