commit_msg
stringlengths 1
24.2k
| commit_hash
stringlengths 2
84
⌀ | project
stringlengths 2
40
| source
stringclasses 4
values | labels
int64 0
1
| repo_url
stringlengths 26
70
⌀ | commit_url
stringlengths 74
118
⌀ | commit_date
stringlengths 25
25
⌀ |
---|---|---|---|---|---|---|---|
Document how we do embargoed releases
Whenever we fix critical vulnerabilities, we follow some sort of
protocol (e.g. setting a coordinated release date, keeping the fix under
embargo until that time, coordinating with packagers and/or hosting
sites, etc).
Similar in spirit to `Documentation/howto/maintain-git.txt`, let's
formalize the details in a document.
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 09420b7648eecf681c5393e3690301897397b30d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/09420b7648eecf681c5393e3690301897397b30d | 2021-03-26 22:12:46+00:00 |
Merge branch 'ma/roll-back-lockfiles'
Some codepaths used to take a lockfile and did not roll it back;
they are automatically rolled back at program exit, so there is no
real "breakage", but it still is a good practice to roll back when
you are done with a lockfile.
* ma/roll-back-lockfiles:
sequencer: do not roll back lockfile unnecessarily
merge: always roll back lock in `checkout_fast_forward()`
merge-recursive: always roll back lock in `merge_recursive_generic()`
sequencer: always roll back lock in `do_recursive_merge()`
sequencer: make lockfiles non-static
| 787aa97f217eb97827205271daba6d95c80b9049 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/787aa97f217eb97827205271daba6d95c80b9049 | 2018-03-14 12:01:03-07:00 |
Merge branch 'mm/two-more-xstrfmt' into maint
Code clean-up and a string truncation fix.
* mm/two-more-xstrfmt:
bisect_next_all: convert xsnprintf to xstrfmt
stop_progress_msg: convert xsnprintf to xstrfmt
| f989ac276d310564364482979a78b83d113c4044 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/f989ac276d310564364482979a78b83d113c4044 | 2017-03-16 13:56:43-07:00 |
Merge branch 'nd/worktree-prune'
The way "git worktree prune" worked internally has been simplified,
by assuming how "git worktree move" moves an existing worktree to a
different place.
* nd/worktree-prune:
worktree prune: improve prune logic when worktree is moved
worktree: delete dead code
gc.txt: more details about what gc does
| ca923f72653f5bfc61933ee334ca5fe34d4fe5f0 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/ca923f72653f5bfc61933ee334ca5fe34d4fe5f0 | 2018-04-10 08:25:45+09:00 |
Merge branch 'ks/commit-abort-on-empty-message-fix'
"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong. The message has been
corrected.
* ks/commit-abort-on-empty-message-fix:
commit: check for empty message before the check for untouched template
| 2b473ce78c5af196caf219fe021c0453108e0244 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/2b473ce78c5af196caf219fe021c0453108e0244 | 2017-08-11 13:27:01-07:00 |
add: speed up cmd_add() by utilizing read_cache_preload()
During an "add", a call is made to run_diff_files() which calls
check_removed() for each index-entry. The preload_index() code
distributes some of the costs across multiple threads.
Because the files checked are restricted to pathspec, adding
individual files makes no measurable impact but on a Windows repo
with ~200K files, 'git add .' drops from 6.3 seconds to 3.3 seconds
for a 47% savings.
Signed-off-by: Ben Peart <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| d1664e73ad96aa08735bf81d48ec0fb6d196cc3e | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/d1664e73ad96aa08735bf81d48ec0fb6d196cc3e | 2018-11-02 09:30:50-04:00 |
t6301: make hash size independent
Instead of hard-coding a fixed length example object ID in the test,
compute one using the translation tables. Move a variable into the
setup block so that we can ensure the exit status of test_oid is
checked.
Signed-off-by: brian m. carlson <[email protected]>
Reviewed-by: Eric Sunshine <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| abe3db14cba119d8a91e40f1f77233d6a9c8037b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/abe3db14cba119d8a91e40f1f77233d6a9c8037b | 2020-07-29 23:13:56+00:00 |
t6400: preserve git ls-files exit status code
In t6400, we're checking number of files in the index and the working
tree by piping the output of "git ls-files" to "wc -l", thus losing the
exit status code of git.
Let's use the newly introduced test_stdout_line_count in order to check
the exit status code of Git's command.
Signed-off-by: Đoàn Trần Công Danh <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 66c9562013de1d8fc04fb46a75fb88122df303c4 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/66c9562013de1d8fc04fb46a75fb88122df303c4 | 2021-07-04 12:46:11+07:00 |
git-sparse-checkout.txt: add a new EXAMPLES section
Since many users like to learn from examples, provide a section in the
manual with example commands that would be used and a brief explanation
of what each does.
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 5d295dc39606990688766916a2bcf93dc0efb61b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/5d295dc39606990688766916a2bcf93dc0efb61b | 2022-04-22 02:32:23+00:00 |
Merge branch 'jh/trace2'
A more structured way to obtain execution trace has been added.
* jh/trace2:
trace2: add for_each macros to clang-format
trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh
trace2:data: add subverb for rebase
trace2:data: add subverb to reset command
trace2:data: add subverb to checkout command
trace2:data: pack-objects: add trace2 regions
trace2:data: add trace2 instrumentation to index read/write
trace2:data: add trace2 hook classification
trace2:data: add trace2 transport child classification
trace2:data: add trace2 sub-process classification
trace2:data: add editor/pager child classification
trace2:data: add trace2 regions to wt-status
trace2: collect Windows-specific process information
trace2: create new combined trace facility
trace2: Documentation/technical/api-trace2.txt
| 32038fef00b02fb52f362d1d0cf1c25c6c382abb | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/32038fef00b02fb52f362d1d0cf1c25c6c382abb | 2019-03-07 09:59:56+09:00 |
branch: change "--local" to "--list" in comment
There has never been a "git branch --local", this is just a typo for
"--list". Fixes a comment added in 23e714df91c (branch: roll
show_detached HEAD into regular ref_list, 2015-09-23).
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| ffdd02a55d994da202acd2c792cc1218bbfa8197 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/ffdd02a55d994da202acd2c792cc1218bbfa8197 | 2021-01-06 11:01:35+01:00 |
Merge branch 'tb/push-to-cygwin-unc-path'
On Cygwin, similar to Windows, "git push //server/share/repository"
ought to mean a repository on a network share that can be accessed
locally, but this did not work correctly due to stripping the double
slashes at the beginning.
This may need to be heavily tested before it gets unleashed to the
wild, as the change is at a fairly low-level code and would affect
not just the code to decide if the push destination is local. There
may be unexpected fallouts in the path normalization.
* tb/push-to-cygwin-unc-path:
cygwin: allow pushing to UNC paths
| 33400c0e96460f36708789a6a3c8eeb7cbc8f0cc | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/33400c0e96460f36708789a6a3c8eeb7cbc8f0cc | 2017-07-18 12:48:09-07:00 |
l10n: vi(5367t): Updated translation
Signed-off-by: Tran Ngoc Quan <[email protected]>
| 84189f4d151eda23ab318b63721238d864fc411d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/84189f4d151eda23ab318b63721238d864fc411d | 2022-06-25 08:40:42+07:00 |
git-p4: removed brackets when assigning multiple return values
In several places, git-p4 contains code of the form:
(a, b) = foo()
In each case, multiple values are returned through a tuple or a list and
bound into multiple values.
The brackets around the assigned variables are redundant and can be
removed:
a, b = foo()
Signed-off-by: Joel Holdsworth <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 0874bb016a06703d942092c23922c1e4e2bf5f4a | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/0874bb016a06703d942092c23922c1e4e2bf5f4a | 2022-04-01 15:24:52+01:00 |
completion: add --continue option for merge
Add 'git merge --continue' option when completing.
Signed-off-by: Chris Packham <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| c261a87e704679203510d48ff4db7bc7006b8a5a | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/c261a87e704679203510d48ff4db7bc7006b8a5a | 2016-12-14 21:37:56+13:00 |
t1450: test fsck of packed objects
The code paths in fsck for packed and loose objects are
quite different, and it is not immediately obvious that the
packed case behaves well. In particular:
1. The fsck_loose() function always returns "0" to tell the
iterator to keep checking more objects. Whereas
fsck_obj_buffer() (which handles packed objects)
returns -1. This is OK, because the callback machinery
for verify_pack() does not stop when it sees a non-zero
return.
2. The fsck_loose() function sets the ERROR_OBJECT bit
when fsck_obj() fails, whereas fsck_obj_buffer() sets it
only when it sees a corrupt object. This turns out not
to matter. We don't actually do anything with this bit
except exit the program with a non-zero code, and that
is handled already by the non-zero return from the
function.
So there are no bugs here, but it was certainly confusing to
me. And we do not test either of the properties in t1450
(neither that a non-corruption error will caused a non-zero
exit for a packed object, nor that we keep going after
seeing the first error). Let's test both of those
conditions, so that we'll notice if any of those assumptions
becomes invalid.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 118e6cead47fafa17db12fdec9b997535f4f0fc6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/118e6cead47fafa17db12fdec9b997535f4f0fc6 | 2017-01-13 12:55:55-05:00 |
switch: add short option for --detach
"git checkout" automatically detaches branches and --detach is not
that useful (--no-detach is more likely). But for "switch", you
may want to use it more often once you're used to detached HEAD. This
of course adds -d to git-checkout but it does not harm (yet?) to do it.
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 163e3b2975cf07e72c81df4bcdf3d74ae667f4d8 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/163e3b2975cf07e72c81df4bcdf3d74ae667f4d8 | 2019-03-29 17:39:12+07:00 |
send-email: fix regression in sendemail.identity parsing
Fix a regression in my recent 3494dfd3ee ("send-email: do defaults ->
config -> getopt in that order", 2019-05-09). I missed that the
$identity variable needs to be extracted from the command-line before
we do the config reading, as it determines which config variable we
should read first. See [1] for the report.
The sendemail.identity feature was added back in
34cc60ce2b ("send-email: Add support for SSL and SMTP-AUTH",
2007-09-03), there were no tests to assert that it worked properly.
So let's fix both the regression, and add some tests to assert that
this is being parsed properly. While I'm at it I'm adding a
--no-identity option to go with --[to|cc|bcc] variable, since the
semantics are similar. It's like to/cc/bcc except that unlike those we
don't support multiple identities, but we could now easily add it
support for it if anyone cares.
In just fixing the --identity command-line parsing bug I discovered
that a narrow fix to that wouldn't do. In read_config() we had a state
machine that would only set config values if they weren't set already,
and thus by proxy we wouldn't e.g. set "to" based on sendemail.to if
we'd seen sendemail.gmail.to before, with --identity=gmail.
I'd modified some of the relevant code in 3494dfd3ee, but just
reverting to that wouldn't do, since it would bring back the
regression fixed in that commit.
Refactor read_config() do what we actually mean here. We don't want to
set a given sendemail.VAR if a sendemail.$identity.VAR previously set
it. The old code was conflating this desire with the hardcoded
defaults for these variables, and as discussed in 3494dfd3ee that was
never going to work. Instead pass along the state of whether an
identity config set something before, as distinguished from the state
of the default just being false, or the default being a non-bool or
true (e.g. --transferencoding).
I'm still not happy with the test coverage here, e.g. there's nothing
testing sendemail.smtpEncryption, but I only have so much time to fix
this code.
1. https://public-inbox.org/git/[email protected]/
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3ff15040e22676db0b369efbd8b908b8fcc9b38d | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3ff15040e22676db0b369efbd8b908b8fcc9b38d | 2019-05-17 21:55:44+02:00 |
add_delta_base_cache: use list_for_each_safe
We may remove elements from the list while we are iterating,
which requires using a second temporary pointer. Otherwise
stepping to the next element of the list might involve
looking at freed memory (which generally works in practice,
as we _just_ freed it, but of course is wrong to rely on;
valgrind notices it).
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 4b92bae7d363adfe923337f198f9c98dc1c68e27 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/4b92bae7d363adfe923337f198f9c98dc1c68e27 | 2016-09-12 12:46:17-04:00 |
l10n: de.po: translate 'symbolic link' as 'symbolische Verknüpfung'
The use of 'symbolische Verknüpfung' for 'symbolic link' is more common
than 'symbolischer Verweis'.
Signed-off-by: Matthias Rüster <[email protected]>
Signed-off-by: Ralf Thielow <[email protected]>
| 918de7523dfbe450ca9a136e199b4cb76150a287 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/918de7523dfbe450ca9a136e199b4cb76150a287 | 2015-03-29 03:46:32+02:00 |
rebase: factor out branch_base calculation
Separate out calculating the merge base between 'onto' and 'HEAD' from
the check for whether we can fast-forward or not. This means we can skip
the fast-forward checks when the rebase is forced and avoid calculating
the merge-base between 'HEAD' and 'onto' when --keep-base is given.
Signed-off-by: Phillip Wood <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| d42c9ffa0fa169ea51c971d1143b3f20d5a32d83 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/d42c9ffa0fa169ea51c971d1143b3f20d5a32d83 | 2022-10-17 13:17:43+00:00 |
Merge branch 'es/tutorial-mention-asciidoc-early'
Doc update.
* es/tutorial-mention-asciidoc-early:
MyFirstContribution: clarify asciidoc dependency
| c5b2c9a8cbd743218f57db0a4f1db47aa9e99b2b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/c5b2c9a8cbd743218f57db0a4f1db47aa9e99b2b | 2020-11-02 13:17:46-08:00 |
test-mergesort: use mem_pool for sort input
The previous patch almost halved the number of heap allocations for the
sort subcommand. Reduce it further by using a mem_pool for the line
objects.
Note that t/perf/run can't be used directly to compare two versions of
test-mergesort because it always runs the helpers from the checked-out
version. So I hand-merged the results of separate runs before and with
this patch:
macOS 12.5.1 on M1:
0071.12: DEFINE_LIST_SORT unsorted 0.22(0.20+0.01) 0.21(0.19+0.01)
0071.14: DEFINE_LIST_SORT sorted 0.10(0.08+0.01) 0.10(0.08+0.01)
0071.16: DEFINE_LIST_SORT reversed 0.10(0.08+0.01) 0.10(0.08+0.01)
Git SDK 64-bit on Windows 11 21H2 on Ryzen 7 5800H:
0071.12: DEFINE_LIST_SORT unsorted 0.54(0.00+0.06) 0.44(0.01+0.06)
0071.14: DEFINE_LIST_SORT sorted 0.21(0.03+0.03) 0.19(0.04+0.01)
0071.16: DEFINE_LIST_SORT reversed 0.21(0.01+0.04) 0.19(0.04+0.04)
Debian bullseye on WSL2 on the same system:
0071.12: DEFINE_LIST_SORT unsorted 0.29(0.27+0.01) 0.22(0.19+0.02)
0071.14: DEFINE_LIST_SORT sorted 0.07(0.06+0.01) 0.06(0.04+0.02)
0071.16: DEFINE_LIST_SORT reversed 0.07(0.04+0.03) 0.06(0.04+0.02)
Signed-off-by: René Scharfe <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| c333c2ce651d5b363ec67d33559ebd9a717ced68 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/c333c2ce651d5b363ec67d33559ebd9a717ced68 | 2022-08-28 12:34:47+02:00 |
merge-recursive: fix miscellaneous grammar error in comment
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 2d6bad918d584bd6bfeb134790cc3233c2283884 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/2d6bad918d584bd6bfeb134790cc3233c2283884 | 2018-06-09 21:16:11-07:00 |
gc: call fscanf() with %<len>s, not %<len>c, when reading hostname
Earlier in this codepath, we (ab)used "%<len>c" to read the hostname
recorded in the lockfile into locking_host[HOST_NAME_MAX + 1] while
substituting <len> with the actual value of HOST_NAME_MAX.
This turns out to be incorrect, as it is an instruction to read
exactly the specified number of bytes. Because we are trying to
read at most that many bytes, we should be using "%<len>s" instead.
Helped-by: A. Wilcox <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| afe2fab72c3151d02314ab5ef3708cd203c499e5 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/afe2fab72c3151d02314ab5ef3708cd203c499e5 | 2017-09-17 12:16:55+09:00 |
cvsimport: apply shell-quoting regex globally
Commit 5b4efea666 (cvsimport: shell-quote variable used in
backticks, 2017-09-11) tried to shell-quote a variable, but
forgot to use the "/g" modifier to apply the quoting to the
whole variable. This means we'd miss any embedded
single-quotes after the first one.
Reported-by: <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 8c87bdfb2137c9e9e945df13e2f2e1eb995ddf83 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/8c87bdfb2137c9e9e945df13e2f2e1eb995ddf83 | 2017-12-08 04:58:19-05:00 |
Merge branch 'js/security-md'
SECURITY.md that is facing individual contributors and end users
has been introduced. Also a procedure to follow when preparing
embargoed releases has been spelled out.
* js/security-md:
Document how we do embargoed releases
SECURITY: describe how to report vulnerabilities
| 3cf14f88de8ad1994ea0a4539edca4ae6adfd27b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3cf14f88de8ad1994ea0a4539edca4ae6adfd27b | 2021-04-07 16:54:09-07:00 |
Merge branch 'wb/fsmonitor-bitmap-fix'
A segfault fix.
* wb/fsmonitor-bitmap-fix:
fsmonitor: don't fill bitmap with entries to be removed
| 22dd22dce050f042b3eec165440966186691db42 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/22dd22dce050f042b3eec165440966186691db42 | 2019-10-23 14:43:10+09:00 |
Merge branch 'ar/request-pull-phrasofix' into maint
Spell the name of our system as "Git" in the output from
request-pull script.
* ar/request-pull-phrasofix:
request-pull: capitalise "Git" to make it a proper noun
| d9f5ea42ff04432d2e41c3d3d7d97a1eabe4f4f5 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/d9f5ea42ff04432d2e41c3d3d7d97a1eabe4f4f5 | 2017-10-18 14:19:04+09:00 |
Merge branch 'bc/format-patch-null-from-line'
"format-patch" has learned a new option to zero-out the commit
object name on the mbox "From " line.
* bc/format-patch-null-from-line:
format-patch: check that header line has expected format
format-patch: add an option to suppress commit hash
sha1_file.c: introduce a null_oid constant
| fbe959dde7eafcdae859e21cd734c07c7890c0a4 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/fbe959dde7eafcdae859e21cd734c07c7890c0a4 | 2015-12-21 10:59:07-08:00 |
sequencer: fix missing newline
When using rebase --interactive where one of the lines is marked as
'edit' this is the resulting output:
Stopped at ec3b9c4... stuffYou can amend the commit now, with
git commit --amend
Once you are satisfied with your changes, run
git rebase --continue
A newline character is missing at the end of the "Stopped at ..." line and
before the "You can amend ..." line. This patch fixes the malformed output by
adding the missing newline character to the end of the "Stopped at ..." line.
Signed-off-by: Brandon Williams <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| a42e1b4194b02638ea4f590ac1e7d231274886d1 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a42e1b4194b02638ea4f590ac1e7d231274886d1 | 2017-03-23 10:02:33-07:00 |
Merge branch 'ma/bisect-leakfix' into maint
Leak fixes.
* ma/bisect-leakfix:
bisect: fix memory leak when returning best element
bisect: fix off-by-one error in `best_bisection_sorted()`
bisect: fix memory leak in `find_bisection()`
bisect: change calling-convention of `find_bisection()`
| 03e8004f0674a704330519d07fa84957989e2686 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/03e8004f0674a704330519d07fa84957989e2686 | 2017-11-27 10:57:02+09:00 |
read-cache.c: fix writing "link" index ext with null base oid
Since commit 7db118303a (unpack_trees: fix breakage when o->src_index !=
o->dst_index - 2018-04-23) and changes in merge code to use separate
index_state for source and destination, when doing a merge with split
index activated, we may run into this line in unpack_trees():
o->result.split_index = init_split_index(&o->result);
This is by itself not wrong. But this split index information is not
fully populated (and it's only so when move_cache_to_base_index() is
called, aka force splitting the index, or loading index_state from a
file). Both "base_oid" and "base" in this case remain null.
So when writing the main index down, we link to this index with null
oid (default value after init_split_index()), which also means "no split
index" internally. This triggers an incorrect base index refresh:
warning: could not freshen shared index '.../sharedindex.0{40}'
This patch makes sure we will not refresh null base_oid (because the
file is never there). It also makes sure not to write "link" extension
with null base_oid in the first place (no point having it at
all). Read code already has protection against null base_oid.
There is also another side fix in remove_split_index() that causes a
crash when doing "git update-index --no-split-index" when base_oid in
the index file is null. In this case we will not load
istate->split_index->base but we dereference it anyway and are rewarded
with a segfault. This should not happen anymore, but it's still wrong to
dereference a potential NULL pointer, especially when we do check for
NULL pointer in the next code.
Reported-by: Luke Diamand <[email protected]>
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 6e37c8ed3c899385651f5beac1f1588fe3c1f5fb | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/6e37c8ed3c899385651f5beac1f1588fe3c1f5fb | 2019-02-13 16:51:29+07:00 |
msvc: add a Makefile target to pre-generate the Visual Studio solution
The entire idea of generating the VS solution makes only sense if we
generate it via Continuous Integration; otherwise potential users would
still have to download the entire Git for Windows SDK.
If we pre-generate the Visual Studio solution, Git can be built entirely
within Visual Studio, and the test scripts can be run in a regular Git
for Windows (e.g. the Portable Git flavor, which does not include a full
GCC toolchain and therefore weighs only about a tenth of Git for
Windows' SDK).
So let's just add a target in the Makefile that can be used to generate
said solution; The generated files will then be committed so that they
can be pushed to a branch ready to check out by Visual Studio users.
To make things even more useful, we also generate and commit other files
that are required to run the test suite, such as templates and
bin-wrappers: with this, developers can run the test suite in a regular
Git Bash after building the solution in Visual Studio.
Note: for this build target, we do not actually need to initialize the
`vcpkg` system, so we don't.
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 976aaedca0c6f64b37f4241bf06fa7ab06095986 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/976aaedca0c6f64b37f4241bf06fa7ab06095986 | 2019-07-29 13:08:12-07:00 |
cocci: fix incorrect & verbose "the_repository" rules
When these rules started being added in [1] they didn't use a ";"
after the ")", and would thus catch uses of these macros within
expressions. But as of [2] the new additions were broken in that
they'd only match a subset of the users of these macros.
Rather than narrowly fixing that, let's have these use the much less
verbose pattern introduced in my recent [3]: There's no need to
exhaustively enumerate arguments if we use the "..." syntax. This
means that we can fold all of these different rules into one.
1. afd69dcc219 (object-store: prepare read_object_file to deal with
any repo, 2018-11-13)
2. 21a9651ba3f (commit-reach: prepare get_merge_bases to handle any
repo, 2018-11-13)
3. 0e6550a2c63 (cocci: add a index-compatibility.pending.cocci,
2022-11-19)
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 6f1436ba2a72bfcbeac9688fa7fe374870a49779 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/6f1436ba2a72bfcbeac9688fa7fe374870a49779 | 2023-03-28 15:58:43+02:00 |
l10n: ca.po: update translation
Signed-off-by: Alex Henrie <[email protected]>
| 573ed5e14717c7bcccbb51357cc311a482135346 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/573ed5e14717c7bcccbb51357cc311a482135346 | 2015-01-26 10:12:50-07:00 |
t7507-commit-verbose: improve test coverage by testing number of diffs
Make the fake "editor" store output of grep in a file so that we can
see how many diffs were contained in the message and use them in
individual tests where ever it is required. A subsequent commit will
introduce scenarios where it is important to be able to exactly
determine how many diffs were present.
The fake "editor" is always made to succeed regardless of whether grep
found diff headers or not so that we don't have to use 'test_must_fail'
for which 'test_line_count = 0' is an easy substitute and also helps in
maintaining the consistency.
Also use write_script() to create the fake "editor".
Helped-by: Eric Sunshine <[email protected]>
Signed-off-by: Pranit Bauva <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| de45dbb8188ecbc74c1e8a95bf861c6acdda393d | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/de45dbb8188ecbc74c1e8a95bf861c6acdda393d | 2016-05-05 15:20:01+05:30 |
pager: remove obsolete comment
The comment at the top of pager.c claims that we've split
the code out so that Windows can do something different.
This dates back to f67b45f (Introduce trivial new pager.c
helper infrastructure, 2006-02-28), because the original
implementation used fork(). Later, we ended up sticking the
Windows #ifdefs into this file anyway. And then even later,
in ea27a18 (spawn pager via run_command interface,
2008-07-22) we unified the implementations.
So these days this comment is really saying nothing at all.
Let's drop it.
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 01e7e90359aa6fa54d00201843e1bb5f02b632f5 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/01e7e90359aa6fa54d00201843e1bb5f02b632f5 | 2016-09-12 20:23:40-07:00 |
Merge branch 'jc/bisect-sans-show-branch'
"git bisect" spawned "git show-branch" only to pretty-print the
title of the commit after checking out the next version to be
tested; this has been rewritten in C.
* jc/bisect-sans-show-branch:
bisect: simplify return code from bisect_checkout()
bisect: do not run show-branch just to show the current commit
| ae2d05d0c6b1834cfcfc5e060db6cf8d91160c5b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/ae2d05d0c6b1834cfcfc5e060db6cf8d91160c5b | 2021-08-24 15:32:35-07:00 |
builtin/fetch-pack: add --refetch option
Add a refetch option to fetch-pack to force a full fetch. Use when
applying a new partial clone filter to refetch all matching objects.
Signed-off-by: Robert Coup <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 869a0eb4ebddad9ea758464526524ed06f5a13a9 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/869a0eb4ebddad9ea758464526524ed06f5a13a9 | 2022-03-28 14:02:07+00:00 |
l10n: pt_PT: add Portuguese translations part 2
* Eliminated 'Negation of emptiness' of 'nenhum' (not one/none)
* Eliminated 'Negation of emptiness' of 'nada' (nothing)
* Transformed 'Não' (No) into affirmative
* Some other translations
* Transforming 'não' (no) into affirmative
* From junção-de-3 to tri-junção
Signed-off-by: Daniel Santos <[email protected]>
| e9488197ad50d81ac8f6736cf995dc5b606f38ee | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/e9488197ad50d81ac8f6736cf995dc5b606f38ee | 2021-03-15 20:33:33+00:00 |
worktree: fix "add -B"
Current code does not update "symref" when -B is used. This string
contains the new HEAD. Because it's empty "git worktree add -B" fails at
symbolic-ref step.
Because branch creation is already done before calling add_worktree(),
-B is equivalent to -b from add_worktree() point of view. We do not need
the special case for -B.
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 0ebf4a2af3b72847327e977c5710fd123926570e | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/0ebf4a2af3b72847327e977c5710fd123926570e | 2016-02-15 20:35:32+07:00 |
Merge branch 'tb/clone-case-smashing-warning-test'
The code recently added to "git clone" to see if the platform's
filesystem is adequate to check out and use the project code
correctly (e.g. a case smashing filesystem cannot be used for a
project with two files whose paths are different only in case) was
meant to help Windows users, but the test for it was not enabled
for that platform, which has been corrected.
* tb/clone-case-smashing-warning-test:
t5601-99: Enable colliding file detection for MINGW
| 590e5b88ece260559b3489321040e4bbbb0f878b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/590e5b88ece260559b3489321040e4bbbb0f878b | 2018-11-26 23:13:42+09:00 |
Merge branch 'js/t3404-typofix' into maint
Typofix.
* js/t3404-typofix:
t3404: fix a typo
| 0726f13074c1c93cdedd8a9f6a10b579fd6ecba6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/0726f13074c1c93cdedd8a9f6a10b579fd6ecba6 | 2019-07-29 12:38:14-07:00 |
config.c: don't leak memory in handle_path_include()
Fix a memory leak in the error() path in handle_path_include(), this
allows us to run t1305-config-include.sh under SANITIZE=leak,
previously 4 tests there would fail. This fixes up a leak in
9b25a0b52e0 (config: add include directive, 2012-02-06).
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 25ad722126c77a546ab1ac7111f090bd8d0e3c13 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/25ad722126c77a546ab1ac7111f090bd8d0e3c13 | 2021-10-21 21:54:14+02:00 |
git-p4: fix instantiation of CalledProcessError
CalledProcessError is an exception class from the subprocess namespace.
When raising this exception, git-p4 would instantiate CalledProcessError
objects without properly referencing the subprocess namespace causing
the script to fail.
Resolves the issue by replacing CalledProcessError with
subprocess.CalledProcessError.
Signed-off-by: Joel Holdsworth <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 40e7cfdd46eb14e63ae4238e3a067d955de54a3d | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/40e7cfdd46eb14e63ae4238e3a067d955de54a3d | 2022-01-06 21:41:56+00:00 |
Merge branch 'js/no-more-legacy-stash'
Removal of unused code and doc.
* js/no-more-legacy-stash:
stash: stop warning about the obsolete `stash.useBuiltin` config setting
stash: remove documentation for `stash.useBuiltin`
add: remove support for `git-legacy-stash`
git-sh-setup: remove remnant bits referring to `git-legacy-stash`
| b9f791aee653932e87d558e5fd841d3394c70727 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/b9f791aee653932e87d558e5fd841d3394c70727 | 2022-02-16 15:14:30-08:00 |
fsck: document the new receive.fsck.<msg-id> options
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 4b55b9b4793b2b134fb439161d5407168cd88dcc | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/4b55b9b4793b2b134fb439161d5407168cd88dcc | 2015-06-22 17:27:00+02:00 |
Merge branch 'jk/t5562-perl-path-fix'
Hotfix for test breakage on platforms whose Perl is not at
/usr/bin/perl
* jk/t5562-perl-path-fix:
t5562: fix perl path
| ab15ccde3d7555135f3730aa5c5f303a96bdf0fb | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/ab15ccde3d7555135f3730aa5c5f303a96bdf0fb | 2018-11-26 23:13:41+09:00 |
Merge branch 'sa/cat-file-mailmap'
"git cat-file" learned an option to use the mailmap when showing
commit and tag objects.
* sa/cat-file-mailmap:
cat-file: add mailmap support
ident: rename commit_rewrite_person() to apply_mailmap_to_header()
ident: move commit_rewrite_person() to ident.c
revision: improve commit_rewrite_person()
| 87098a047be46ee69da056336109eee2139c1398 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/87098a047be46ee69da056336109eee2139c1398 | 2022-08-03 13:36:08-07:00 |
Merge branch 'js/commit-graph-parse-leakfix'
Leakfix.
* js/commit-graph-parse-leakfix:
commit-graph: fix memory leak
| 3c9b393ca8fdb4db53e461a6f506dd10ed6fbc85 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3c9b393ca8fdb4db53e461a6f506dd10ed6fbc85 | 2019-05-19 16:45:28+09:00 |
blame: create scoreboard init function
Create function that initializes blame_scoreboard to default values.
Signed-off-by: Jeff Smith <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/6e4c9b5bcf2c4c9e29513949ad8b465d7afe88f1 | 2017-05-24 00:15:29-05:00 |
i18n: remote: add comment for translators
Add comment drawing translator attention in order to align "Push
URL:" and "Fetch URL:" fields translation of git remote show output.
Aligning both fields makes the output more appealing and easier to
grasp.
Signed-off-by: Vasco Almeida <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 6c1fbe1e41dadc6a0b2efdebb2fe703ac3bb1f6b | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/6c1fbe1e41dadc6a0b2efdebb2fe703ac3bb1f6b | 2016-05-08 20:00:18+00:00 |
docs: fix formatting of rev-parse's --show-superproject-working-tree
Signed-off-by: Sebastian Schuberth <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| e38c681fb7b9d9571cbcb441125759ffc4977ee2 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/e38c681fb7b9d9571cbcb441125759ffc4977ee2 | 2017-10-26 11:53:37+00:00 |
Merge branch 'jc/cat-file-batch-default-format-optim'
Optimize away strbuf_expand() call with a hardcoded formatting logic
specific for the default format in the --batch and --batch-check
options of "git cat-file".
* jc/cat-file-batch-default-format-optim:
cat-file: skip expanding default format
| 889860e1ad85340896f404155f2f16621ca6989e | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/889860e1ad85340896f404155f2f16621ca6989e | 2022-03-23 14:09:31-07:00 |
Merge branch 'jk/reset-to-break-a-commit-doc'
A minor doc update.
* jk/reset-to-break-a-commit-doc:
reset: add an example of how to split a commit into two
| 5c40e9ce8170991b9d6580fa1550e0a204e0f4ab | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/5c40e9ce8170991b9d6580fa1550e0a204e0f4ab | 2017-02-10 12:52:23-08:00 |
Merge branch 'ds/sparse-list-in-cone-mode'
"git sparse-checkout list" subcommand learned to give its output in
a more concise form when the "cone" mode is in effect.
* ds/sparse-list-in-cone-mode:
sparse-checkout: document interactions with submodules
sparse-checkout: list directories in cone mode
| c20d4fd44a9f9016341eb5971a153b5ad542718c | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/c20d4fd44a9f9016341eb5971a153b5ad542718c | 2020-01-06 14:17:51-08:00 |
Merge branch 'rs/add-index-entry-optim-fix' into master
Fix to an ancient bug caused by an over-eager attempt for
optimization.
* rs/add-index-entry-optim-fix:
read-cache: remove bogus shortcut
| a20e20e4c8fe6c13e03af8109644a84d8f4e7f7f | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a20e20e4c8fe6c13e03af8109644a84d8f4e7f7f | 2020-07-30 13:20:33-07:00 |
sparse index: fix use-after-free bug in cache_tree_verify()
In a sparse index it is possible for the tree that is being verified
to be freed while it is being verified. This happens when the index is
sparse but the cache tree is not and index_name_pos() looks up a path
from the cache tree that is a descendant of a sparse index entry. That
triggers a call to ensure_full_index() which frees the cache tree that
is being verified. Carrying on trying to verify the tree after this
results in a use-after-free bug. Instead restart the verification if a
sparse index is converted to a full index. This bug is triggered by a
call to reset_head() in "git rebase --apply". Thanks to René Scharfe
and Derrick Stolee for their help analyzing the problem.
==74345==ERROR: AddressSanitizer: heap-use-after-free on address 0x606000001b20 at pc 0x557cbe82d3a2 bp 0x7ffdfee08090 sp 0x7ffdfee08080
READ of size 4 at 0x606000001b20 thread T0
#0 0x557cbe82d3a1 in verify_one /home/phil/src/git/cache-tree.c:863
#1 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#2 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#3 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#4 0x557cbe830a2b in cache_tree_verify /home/phil/src/git/cache-tree.c:910
#5 0x557cbea53741 in write_locked_index /home/phil/src/git/read-cache.c:3250
#6 0x557cbeab7fdd in reset_head /home/phil/src/git/reset.c:87
#7 0x557cbe72147f in cmd_rebase builtin/rebase.c:2074
#8 0x557cbe5bd151 in run_builtin /home/phil/src/git/git.c:461
#9 0x557cbe5bd151 in handle_builtin /home/phil/src/git/git.c:714
#10 0x557cbe5c0503 in run_argv /home/phil/src/git/git.c:781
#11 0x557cbe5c0503 in cmd_main /home/phil/src/git/git.c:912
#12 0x557cbe5bad28 in main /home/phil/src/git/common-main.c:52
#13 0x7fdd4b82eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
#14 0x557cbe5bcb8d in _start (/home/phil/src/git/git+0x1b9b8d)
0x606000001b20 is located 0 bytes inside of 56-byte region [0x606000001b20,0x606000001b58)
freed by thread T0 here:
#0 0x7fdd4bacff19 in __interceptor_free /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:127
#1 0x557cbe82af60 in cache_tree_free /home/phil/src/git/cache-tree.c:35
#2 0x557cbe82aee5 in cache_tree_free /home/phil/src/git/cache-tree.c:31
#3 0x557cbe82aee5 in cache_tree_free /home/phil/src/git/cache-tree.c:31
#4 0x557cbe82aee5 in cache_tree_free /home/phil/src/git/cache-tree.c:31
#5 0x557cbeb2557a in ensure_full_index /home/phil/src/git/sparse-index.c:310
#6 0x557cbea45c4a in index_name_stage_pos /home/phil/src/git/read-cache.c:588
#7 0x557cbe82ce37 in verify_one /home/phil/src/git/cache-tree.c:850
#8 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#9 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#10 0x557cbe82ca9d in verify_one /home/phil/src/git/cache-tree.c:840
#11 0x557cbe830a2b in cache_tree_verify /home/phil/src/git/cache-tree.c:910
#12 0x557cbea53741 in write_locked_index /home/phil/src/git/read-cache.c:3250
#13 0x557cbeab7fdd in reset_head /home/phil/src/git/reset.c:87
#14 0x557cbe72147f in cmd_rebase builtin/rebase.c:2074
#15 0x557cbe5bd151 in run_builtin /home/phil/src/git/git.c:461
#16 0x557cbe5bd151 in handle_builtin /home/phil/src/git/git.c:714
#17 0x557cbe5c0503 in run_argv /home/phil/src/git/git.c:781
#18 0x557cbe5c0503 in cmd_main /home/phil/src/git/git.c:912
#19 0x557cbe5bad28 in main /home/phil/src/git/common-main.c:52
#20 0x7fdd4b82eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
previously allocated by thread T0 here:
#0 0x7fdd4bad0459 in __interceptor_calloc /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x557cbebc1807 in xcalloc /home/phil/src/git/wrapper.c:140
#2 0x557cbe82b7d8 in cache_tree /home/phil/src/git/cache-tree.c:17
#3 0x557cbe82b7d8 in prime_cache_tree_rec /home/phil/src/git/cache-tree.c:763
#4 0x557cbe82b837 in prime_cache_tree_rec /home/phil/src/git/cache-tree.c:764
#5 0x557cbe82b837 in prime_cache_tree_rec /home/phil/src/git/cache-tree.c:764
#6 0x557cbe8304e1 in prime_cache_tree /home/phil/src/git/cache-tree.c:779
#7 0x557cbeab7fa7 in reset_head /home/phil/src/git/reset.c:85
#8 0x557cbe72147f in cmd_rebase builtin/rebase.c:2074
#9 0x557cbe5bd151 in run_builtin /home/phil/src/git/git.c:461
#10 0x557cbe5bd151 in handle_builtin /home/phil/src/git/git.c:714
#11 0x557cbe5c0503 in run_argv /home/phil/src/git/git.c:781
#12 0x557cbe5c0503 in cmd_main /home/phil/src/git/git.c:912
#13 0x557cbe5bad28 in main /home/phil/src/git/common-main.c:52
#14 0x7fdd4b82eb24 in __libc_start_main (/usr/lib/libc.so.6+0x27b24)
Signed-off-by: Phillip Wood <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| f751097be3d456773211036ac2c3e26f6cef30f2 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/f751097be3d456773211036ac2c3e26f6cef30f2 | 2021-10-07 18:07:21+00:00 |
has_uncommitted_changes(): fall back to empty tree
If has_uncommitted_changes() can't resolve HEAD (e.g.,
because it's unborn or corrupt), then we end up calling
run_diff_index() with an empty revs.pending array. This
causes a segfault, as run_diff_index() blindly looks at the
first pending item.
Fixing this raises a question of fault: should
run_diff_index() handle this case, or is the caller wrong to
pass an empty pending list?
Looking at the other callers of run_diff_index(), they
handle this in one of three ways:
- they resolve the object themselves, and avoid doing the
diff if it's not valid
- they resolve the object themselves, and fall back to the
empty tree
- they use setup_revisions(), which will die() if the
object isn't valid
Since this is the only broken caller, that argues that the
fix should go there. Falling back to the empty tree makes
sense here, as we'd claim uncommitted changes if and only if
the index is non-empty. This may be a little funny in the
case of corruption (the corrupt HEAD probably _isn't_
empty), but:
- we don't actually know the reason here that HEAD didn't
resolve (the much more likely case is that we have an
unborn HEAD, in which case the empty tree comparison is
the right thing)
- this matches how other code, like "git diff", behaves
While we're thinking about it, let's add an assertion to
run_diff_index(). It should always be passed a single
object, and as this bug shows, it's easy to get it wrong
(and an assertion is easier to hunt down than a segfault, or
a quietly ignored extra tree).
Reported-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3506dc944558b7d88544408b312e795458383195 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/3506dc944558b7d88544408b312e795458383195 | 2018-07-11 10:14:06-04:00 |
mem-pool: fill out functionality
Add functions for:
- combining two memory pools
- determining if a memory address is within the range managed by a
memory pool
These functions will be used by future commits.
Signed-off-by: Jameson Miller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 0e58301d8199208d1e48b9f64c4ad1089a355905 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/0e58301d8199208d1e48b9f64c4ad1089a355905 | 2018-07-02 19:49:35+00:00 |
grep: fix bug when recursing with relative pathspec
When using the --recurse-submodules flag with a relative pathspec which
includes "..", an error is produced inside the child process spawned for
a submodule. When creating the pathspec struct in the child, the ".."
is interpreted to mean "go up a directory" which causes an error stating
that the path ".." is outside of the repository.
While it is true that ".." is outside the scope of the submodule, it is
confusing to a user who originally invoked the command where ".." was
indeed still inside the scope of the superproject. Since the child
process launched for the submodule has some context that it is operating
underneath a superproject, this error could be avoided.
This patch fixes the bug by passing the 'prefix' to the child process.
Now each child process that works on a submodule has two points of
reference to the superproject: (1) the 'super_prefix' which is the path
from the root of the superproject down to root of the submodule and (2)
the 'prefix' which is the path from the root of the superproject down to
the directory where the user invoked the git command.
With these two pieces of information a child process can correctly
interpret the pathspecs provided by the user as well as being able to
properly format its output relative to the directory the user invoked
the original command from.
Signed-off-by: Brandon Williams <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| be80a2392f5d10395bf934a066faeefdb6bb380a | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/be80a2392f5d10395bf934a066faeefdb6bb380a | 2017-03-17 10:22:55-07:00 |
Merge branch 'js/mingw-o-append'
Further fix for O_APPEND emulation on Windows
* js/mingw-o-append:
mingw: fix mingw_open_append to work with named pipes
t0051: test GIT_TRACE to a windows named pipe
| e3d4ff037db41234eaf74167ab7d1a443c23243d | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/e3d4ff037db41234eaf74167ab7d1a443c23243d | 2018-09-24 10:30:47-07:00 |
bswap: add 64 bit endianness helper get_be64
Add a new get_be64 macro to enable 64 bit endian conversions on memory
that may or may not be aligned.
Signed-off-by: Ben Peart <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| b2e39d0067240e262d77f6c2ac133b77c56bcf1c | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/b2e39d0067240e262d77f6c2ac133b77c56bcf1c | 2017-09-22 12:35:37-04:00 |
usage.c: add a non-fatal bug() function to go with BUG()
Add a bug() function to use in cases where we'd like to indicate a
runtime BUG(), but would like to defer the BUG() call because we're
possibly accumulating more bug() callers to exhaustively indicate what
went wrong.
We already have this sort of facility in various parts of the
codebase, just in the form of ad-hoc re-inventions of the
functionality that this new API provides. E.g. this will be used to
replace optbug() in parse-options.c, and the 'error("BUG:[...]' we do
in a loop in builtin/receive-pack.c.
Unlike the code this replaces we'll log to trace2 with this new bug()
function (as with other usage.c functions, including BUG()), we'll
also be able to avoid calls to xstrfmt() in some cases, as the bug()
function itself accepts variadic sprintf()-like arguments.
Any caller to bug() can follow up such calls with BUG_if_bug(),
which will BUG() out (i.e. abort()) if there were any preceding calls
to bug(), callers can also decide not to call BUG_if_bug() and leave
the resulting BUG() invocation until exit() time. There are currently
no bug() API users that don't call BUG_if_bug() themselves after a
for-loop, but allowing for not calling BUG_if_bug() keeps the API
flexible. As the tests and documentation here show we'll catch missing
BUG_if_bug() invocations in our exit() wrapper.
Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 0cc05b044fd690f37565262a5b09f60c203c5218 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/0cc05b044fd690f37565262a5b09f60c203c5218 | 2022-06-02 14:25:33+02:00 |
tree-diff: fix leak when not HAVE_ALLOCA_H
b8ba412bf7 (tree-diff: avoid alloca for large allocations, 2016-06-07)
adds a way to route some bigger allocations out of the stack and free
them through the addition of two conveniently named macros, but leaves
the calls to free the xalloca part, which could be also in the heap,
if the system doesn't HAVE_ALLOCA_H (ex: macOS and other BSD).
Add the missing free call, xalloca_free(), which is a noop if we
allocated memory in the stack frame, but a real free() if we
allocated in the heap instead, and while at it, change the expression
to match in both macros for ease of readability.
This avoids a leak reported by LSAN while running t0000 but that
wouldn't fail the test (which is fixed in the next patch):
SUMMARY: LeakSanitizer: 1034 byte(s) leaked in 15 allocation(s).
Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 637799bf0ab72a509e1f2b29ee6ab3367eefbff9 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/637799bf0ab72a509e1f2b29ee6ab3367eefbff9 | 2021-09-16 01:55:22-07:00 |
Merge branch 'ep/trace-doc-sample-fix' into maint
Fix a typo in an example in the trace API documentation.
* ep/trace-doc-sample-fix:
api-trace.txt: fix typo
| 4dda133385cedfe530607b6ac9183eeefd2a7b2a | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/4dda133385cedfe530607b6ac9183eeefd2a7b2a | 2016-04-29 14:16:00-07:00 |
Merge branch 'win32-accommodate-funny-drive-names'
While the only permitted drive letters for physical drives on Windows
are letters of the US-English alphabet, this restriction does not apply
to virtual drives assigned via `subst <letter>: <path>`.
To prevent targeted attacks against systems where "funny" drive letters
such as `1` or `!` are assigned, let's handle them as regular drive
letters on Windows.
This fixes CVE-2019-1351.
Signed-off-by: Johannes Schindelin <[email protected]>
| 2ddcccf97a717f9df17a4843c39e3c4f1df49fec | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/2ddcccf97a717f9df17a4843c39e3c4f1df49fec | 2019-09-16 13:26:40+02:00 |
reduce_heads: fix memory leaks
We currently have seven callers of `reduce_heads(foo)`. Six of them do
not use the original list `foo` again, and actually, all six of those
end up leaking it.
Introduce and use `reduce_heads_replace(&foo)` as a leak-free version of
`foo = reduce_heads(foo)` to fix several of these. Fix the remaining
leaks using `free_commit_list()`.
While we're here, document `reduce_heads()` and mark it as `extern`.
Signed-off-by: Martin Ågren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 4da72644b768b0491110a8ba0aa84d32b6bde41c | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/4da72644b768b0491110a8ba0aa84d32b6bde41c | 2017-11-07 21:39:45+01:00 |
blame: use different author name for fake commit generated by --contents
When the --contents option is used with git blame, and the contents of
the file have lines which can't be annotated by the history being
blamed, the user will see an author of "Not Committed Yet". This is
similar to the way blame handles working tree contents when blaming
without a revision.
This is slightly confusing since this data isn't the working copy and
while it is technically "not committed yet", its also coming from an
external file. Replace this author name with "External file
(--contents)" to better differentiate such lines from actual working
copy lines.
Suggested-by: Junio C Hamano <[email protected]>
Suggested-by: Glen Choo <[email protected]>
Signed-off-by: Jacob Keller <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 603d0fdce2ca84d4dc7b26e46430778fe9c4cb72 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/603d0fdce2ca84d4dc7b26e46430778fe9c4cb72 | 2023-04-24 12:35:08-07:00 |
documentation: add documentation for 'git version'
While 'git version' is probably the least complex git command,
it is a non-experimental user-facing builtin command. As such
it should have a help page.
Both `git help` and `git version` can be called as options
(`--help`/`--version`) that internally get converted to the
corresponding command. Add a small paragraph to
Documentation/git.txt describing how these two options
interact with each other and link to this help page for the
sub-options that `--version` can take. Well, currently there
is only one sub-option, but that could potentially increase
in future versions of Git.
Signed-off-by: Matthias Aßhauer <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| b6d8887d3d607e0da971218f20428c0635c6362c | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/b6d8887d3d607e0da971218f20428c0635c6362c | 2021-09-14 13:27:18+00:00 |
l10n: tr: Update Turkish translations for v.2.40.0
Signed-off-by: Emir SARI <[email protected]>
| 8790c93ce6e986677c7162fbc27a2ffaa296daa6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/8790c93ce6e986677c7162fbc27a2ffaa296daa6 | 2023-02-25 13:53:07+03:00 |
Merge branch 'nd/config-misc-fixes' into maint
Leakage of lockfiles in the config subsystem has been fixed.
* nd/config-misc-fixes:
config.c: handle lock file in error case in git_config_rename_...
config.c: rename label unlock_and_out
config.c: handle error case for fstat() calls
| bb7c47a452ce4fa22d25da6a5e7684dbbf7033e2 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/bb7c47a452ce4fa22d25da6a5e7684dbbf7033e2 | 2017-01-31 13:32:06-08:00 |
Merge branch 'ab/send-email-inline-hooks-path'
Code simplification.
* ab/send-email-inline-hooks-path:
send-email: move "hooks_path" invocation to git-send-email.perl
send-email: don't needlessly abs_path() the core.hooksPath
| f4d715b0acaf008d0f09c42378cac90acaadea8e | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/f4d715b0acaf008d0f09c42378cac90acaadea8e | 2021-05-27 12:36:57+09:00 |
Merge branch 'jt/push-negotiation-fixes'
Bugfix for common ancestor negotiation recently introduced in "git
push" code path.
* jt/push-negotiation-fixes:
fetch: die on invalid --negotiation-tip hash
send-pack: fix push nego. when remote has refs
send-pack: fix push.negotiate with remote helper
| 066f6cd44707ca2f8c3dc2a2ae02c2c9784903bf | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/066f6cd44707ca2f8c3dc2a2ae02c2c9784903bf | 2021-08-24 15:32:40-07:00 |
Merge branch 'ar/typofix-gitattributes-doc'
Typofix.
* ar/typofix-gitattributes-doc:
gitattributes.txt: fix typo in "comma separated"
| 09bfb2ed8151c4b34adb73480a679110bedae004 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/09bfb2ed8151c4b34adb73480a679110bedae004 | 2023-01-05 15:07:21+09:00 |
Merge branch 'js/help-commands-verbose-by-default-fix' into maint
"git help -a" did not work well when an overly long alias is
defined, which has been corrected.
* js/help-commands-verbose-by-default-fix:
help -a: handle aliases with long names gracefully
help.h: fix coding style
| 916f56d38bc86cf8bed0698afde5051c05e7cc68 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/916f56d38bc86cf8bed0698afde5051c05e7cc68 | 2018-12-15 12:24:33+09:00 |
Merge branch 'rs/wt-status-detached-branch-fix'
"git status --branch --short" accessed beyond the constant string
"HEAD", which has been corrected.
* rs/wt-status-detached-branch-fix:
wt-status: use skip_prefix() to get rid of magic string length constants
wt-status: don't skip a magical number of characters blindly
wt-status: avoid building bogus branch name with detached HEAD
wt-status: exit early using goto in wt_shortstatus_print_tracking()
t7060: add test for status --branch on a detached HEAD
| a59d1d8035a1a6d878274e97818c56bb691ac5c0 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a59d1d8035a1a6d878274e97818c56bb691ac5c0 | 2015-11-03 15:13:08-08:00 |
config.txt: fix typo
Fix the spelling of "substituted".
Signed-off-by: Martin Ågren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 480f0541b8b22a4528425d348d2db3f572c39350 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/480f0541b8b22a4528425d348d2db3f572c39350 | 2021-10-24 19:07:43+02:00 |
Merge branch 'jk/fast-import-unsafe'
The `--export-marks` option of `git fast-import` is exposed also via the
in-stream command `feature export-marks=...` and it allows overwriting
arbitrary paths.
This topic branch prevents the in-stream version, to prevent arbitrary
file accesses by `git fast-import` streams coming from untrusted sources
(e.g. in remote helpers that are based on `git fast-import`).
This fixes CVE-2019-1348.
Signed-off-by: Johannes Schindelin <[email protected]>
| a7b1ad3b05fd1dc03c3de12ea4f2d8118ad24e2c | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/a7b1ad3b05fd1dc03c3de12ea4f2d8118ad24e2c | 2019-10-03 20:44:34+02:00 |
pretty: fix out-of-bounds write caused by integer overflow
When using a padding specifier in the pretty format passed to git-log(1)
we need to calculate the string length in several places. These string
lengths are stored in `int`s though, which means that these can easily
overflow when the input lengths exceeds 2GB. This can ultimately lead to
an out-of-bounds write when these are used in a call to memcpy(3P):
==8340==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1ec62f97fe at pc 0x7f2127e5f427 bp 0x7ffd3bd63de0 sp 0x7ffd3bd63588
WRITE of size 1 at 0x7f1ec62f97fe thread T0
#0 0x7f2127e5f426 in __interceptor_memcpy /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827
#1 0x5628e96aa605 in format_and_pad_commit pretty.c:1762
#2 0x5628e96aa7f4 in format_commit_item pretty.c:1801
#3 0x5628e97cdb24 in strbuf_expand strbuf.c:429
#4 0x5628e96ab060 in repo_format_commit_message pretty.c:1869
#5 0x5628e96acd0f in pretty_print_commit pretty.c:2161
#6 0x5628e95a44c8 in show_log log-tree.c:781
#7 0x5628e95a76ba in log_tree_commit log-tree.c:1117
#8 0x5628e922bed5 in cmd_log_walk_no_free builtin/log.c:508
#9 0x5628e922c35b in cmd_log_walk builtin/log.c:549
#10 0x5628e922f1a2 in cmd_log builtin/log.c:883
#11 0x5628e9106993 in run_builtin git.c:466
#12 0x5628e9107397 in handle_builtin git.c:721
#13 0x5628e9107b07 in run_argv git.c:788
#14 0x5628e91088a7 in cmd_main git.c:923
#15 0x5628e939d682 in main common-main.c:57
#16 0x7f2127c3c28f (/usr/lib/libc.so.6+0x2328f)
#17 0x7f2127c3c349 in __libc_start_main (/usr/lib/libc.so.6+0x23349)
#18 0x5628e91020e4 in _start ../sysdeps/x86_64/start.S:115
0x7f1ec62f97fe is located 2 bytes to the left of 4831838265-byte region [0x7f1ec62f9800,0x7f1fe62f9839)
allocated by thread T0 here:
#0 0x7f2127ebe7ea in __interceptor_realloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:85
#1 0x5628e98774d4 in xrealloc wrapper.c:136
#2 0x5628e97cb01c in strbuf_grow strbuf.c:99
#3 0x5628e97ccd42 in strbuf_addchars strbuf.c:327
#4 0x5628e96aa55c in format_and_pad_commit pretty.c:1761
#5 0x5628e96aa7f4 in format_commit_item pretty.c:1801
#6 0x5628e97cdb24 in strbuf_expand strbuf.c:429
#7 0x5628e96ab060 in repo_format_commit_message pretty.c:1869
#8 0x5628e96acd0f in pretty_print_commit pretty.c:2161
#9 0x5628e95a44c8 in show_log log-tree.c:781
#10 0x5628e95a76ba in log_tree_commit log-tree.c:1117
#11 0x5628e922bed5 in cmd_log_walk_no_free builtin/log.c:508
#12 0x5628e922c35b in cmd_log_walk builtin/log.c:549
#13 0x5628e922f1a2 in cmd_log builtin/log.c:883
#14 0x5628e9106993 in run_builtin git.c:466
#15 0x5628e9107397 in handle_builtin git.c:721
#16 0x5628e9107b07 in run_argv git.c:788
#17 0x5628e91088a7 in cmd_main git.c:923
#18 0x5628e939d682 in main common-main.c:57
#19 0x7f2127c3c28f (/usr/lib/libc.so.6+0x2328f)
#20 0x7f2127c3c349 in __libc_start_main (/usr/lib/libc.so.6+0x23349)
#21 0x5628e91020e4 in _start ../sysdeps/x86_64/start.S:115
SUMMARY: AddressSanitizer: heap-buffer-overflow /usr/src/debug/gcc/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:827 in __interceptor_memcpy
Shadow bytes around the buggy address:
0x0fe458c572a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe458c572b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe458c572c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe458c572d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe458c572e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0fe458c572f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]
0x0fe458c57300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe458c57310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe458c57320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe458c57330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe458c57340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==8340==ABORTING
The pretty format can also be used in `git archive` operations via the
`export-subst` attribute. So this is what in our opinion makes this a
critical issue in the context of Git forges which allow to download an
archive of user supplied Git repositories.
Fix this vulnerability by using `size_t` instead of `int` to track the
string lengths. Add tests which detect this vulnerability when Git is
compiled with the address sanitizer.
Reported-by: Joern Schneeweisz <[email protected]>
Original-patch-by: Joern Schneeweisz <[email protected]>
Modified-by: Taylor Blau <[email protected]>
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 81dc898df9b4b4035534a927f3234a3839b698bf | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/81dc898df9b4b4035534a927f3234a3839b698bf | 2022-12-01 15:46:25+01:00 |
mingw: disallow backslash characters in tree objects' file names
The backslash character is not a valid part of a file name on Windows.
Hence it is dangerous to allow writing files that were unpacked from
tree objects, when the stored file name contains a backslash character:
it will be misinterpreted as directory separator.
This not only causes ambiguity when a tree contains a blob `a\b` and a
tree `a` that contains a blob `b`, but it also can be used as part of an
attack vector to side-step the careful protections against writing into
the `.git/` directory during a clone of a maliciously-crafted
repository.
Let's prevent that, addressing CVE-2019-1354.
Note: we guard against backslash characters in tree objects' file names
_only_ on Windows (because on other platforms, even on those where NTFS
volumes can be mounted, the backslash character is _not_ a directory
separator), and _only_ when `core.protectNTFS = true` (because users
might need to generate tree objects for other platforms, of course
without touching the worktree, e.g. using `git update-index
--cacheinfo`).
Signed-off-by: Johannes Schindelin <[email protected]>
| e1d911dd4c7b76a5a8cec0f5c8de15981e34da83 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/e1d911dd4c7b76a5a8cec0f5c8de15981e34da83 | 2019-09-12 14:54:05+02:00 |
upload-pack: implement ref-in-want
Currently, while performing packfile negotiation, clients are only
allowed to specify their desired objects using object ids. This causes
a vulnerability to failure when an object turns non-existent during
negotiation, which may happen if, for example, the desired repository is
provided by multiple Git servers in a load-balancing arrangement and
there exists replication delay.
In order to eliminate this vulnerability, implement the ref-in-want
feature for the 'fetch' command in protocol version 2. This feature
enables the 'fetch' command to support requests in the form of ref names
through a new "want-ref <ref>" parameter. At the conclusion of
negotiation, the server will send a list of all of the wanted references
(as provided by "want-ref" lines) in addition to the generated packfile.
Signed-off-by: Brandon Williams <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 516e2b76bdcf53e757309481fa0e663217ee8039 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/516e2b76bdcf53e757309481fa0e663217ee8039 | 2018-06-27 15:30:17-07:00 |
setup_git_directory(): add an owner check for the top-level directory
It poses a security risk to search for a git directory outside of the
directories owned by the current user.
For example, it is common e.g. in computer pools of educational
institutes to have a "scratch" space: a mounted disk with plenty of
space that is regularly swiped where any authenticated user can create
a directory to do their work. Merely navigating to such a space with a
Git-enabled `PS1` when there is a maliciously-crafted `/scratch/.git/`
can lead to a compromised account.
The same holds true in multi-user setups running Windows, as `C:\` is
writable to every authenticated user by default.
To plug this vulnerability, we stop Git from accepting top-level
directories owned by someone other than the current user. We avoid
looking at the ownership of each and every directories between the
current and the top-level one (if there are any between) to avoid
introducing a performance bottleneck.
This new default behavior is obviously incompatible with the concept of
shared repositories, where we expect the top-level directory to be owned
by only one of its legitimate users. To re-enable that use case, we add
support for adding exceptions from the new default behavior via the
config setting `safe.directory`.
The `safe.directory` config setting is only respected in the system and
global configs, not from repository configs or via the command-line, and
can have multiple values to allow for multiple shared repositories.
We are particularly careful to provide a helpful message to any user
trying to use a shared repository.
Signed-off-by: Johannes Schindelin <[email protected]>
| 8959555cee7ec045958f9b6dd62e541affb7e7d9 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9 | 2022-03-02 12:23:04+01:00 |
apply: fix writing behind newly created symbolic links
When writing files git-apply(1) initially makes sure that none of the
files it is about to create are behind a symlink:
```
$ git init repo
Initialized empty Git repository in /tmp/repo/.git/
$ cd repo/
$ ln -s dir symlink
$ git apply - <<EOF
diff --git a/symlink/file b/symlink/file
new file mode 100644
index 0000000..e69de29
EOF
error: affected file 'symlink/file' is beyond a symbolic link
```
This safety mechanism is crucial to ensure that we don't write outside
of the repository's working directory. It can be fooled though when the
patch that is being applied creates the symbolic link in the first
place, which can lead to writing files in arbitrary locations.
Fix this by checking whether the path we're about to create is
beyond a symlink or not. Tightening these checks like this should be
fine as we already have these precautions in Git as explained
above. Ideally, we should update the check we do up-front before
starting to reflect the computed changes to the working tree so that
we catch this case as well, but as part of embargoed security work,
adding an equivalent check just before we try to write out a file
should serve us well as a reasonable first step.
Digging back into history shows that this vulnerability has existed
since at least Git v2.9.0. As Git v2.8.0 and older don't build on my
system anymore I cannot tell whether older versions are affected, as
well.
Reported-by: Joern Schneeweisz <[email protected]>
Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| fade728df1221598f42d391cf377e9e84a32053f | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/fade728df1221598f42d391cf377e9e84a32053f | 2023-02-02 11:54:34+01:00 |
shell: limit size of interactive commands
When git-shell is run in interactive mode (which must be enabled by
creating $HOME/git-shell-commands), it reads commands from stdin, one
per line, and executes them.
We read the commands with git_read_line_interactively(), which uses a
strbuf under the hood. That means we'll accept an input of arbitrary
size (limited only by how much heap we can allocate). That creates two
problems:
- the rest of the code is not prepared to handle large inputs. The
most serious issue here is that split_cmdline() uses "int" for most
of its types, which can lead to integer overflow and out-of-bounds
array reads and writes. But even with that fixed, we assume that we
can feed the command name to snprintf() (via xstrfmt()), which is
stuck for historical reasons using "int", and causes it to fail (and
even trigger a BUG() call).
- since the point of git-shell is to take input from untrusted or
semi-trusted clients, it's a mild denial-of-service. We'll allocate
as many bytes as the client sends us (actually twice as many, since
we immediately duplicate the buffer).
We can fix both by just limiting the amount of per-command input we're
willing to receive.
We should also fix split_cmdline(), of course, which is an accident
waiting to happen, but that can come on top. Most calls to
split_cmdline(), including the other one in git-shell, are OK because
they are reading from an OS-provided argv, which is limited in practice.
This patch should eliminate the immediate vulnerabilities.
I picked 4MB as an arbitrary limit. It's big enough that nobody should
ever run into it in practice (since the point is to run the commands via
exec, we're subject to OS limits which are typically much lower). But
it's small enough that allocating it isn't that big a deal.
The code is mostly just swapping out fgets() for the strbuf call, but we
have to add a few niceties like flushing and trimming line endings. We
could simplify things further by putting the buffer on the stack, but
4MB is probably a bit much there. Note that we'll _always_ allocate 4MB,
which for normal, non-malicious requests is more than we would before
this patch. But on the other hand, other git programs are happy to use
96MB for a delta cache. And since we'd never touch most of those pages,
on a lazy-allocating OS like Linux they won't even get allocated to
actual RAM.
The ideal would be a version of strbuf_getline() that accepted a maximum
value. But for a minimal vulnerability fix, let's keep things localized
and simple. We can always refactor further on top.
The included test fails in an obvious way with ASan or UBSan (which
notice the integer overflow and out-of-bounds reads). Without them, it
fails in a less obvious way: we may segfault, or we may try to xstrfmt()
a long string, leading to a BUG(). Either way, it fails reliably before
this patch, and passes with it. Note that we don't need an EXPENSIVE
prereq on it. It does take 10-15s to fail before this patch, but with
the new limit, we fail almost immediately (and the perl process
generating 2GB of data exits via SIGPIPE).
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Taylor Blau <[email protected]>
| 71ad7fe1bcec2a115bd0ab187240348358aa7f21 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/71ad7fe1bcec2a115bd0ab187240348358aa7f21 | 2022-09-28 18:52:48-04:00 |
Merge branch 'tb/receive-pack-code-cleanup'
Code clean-up.
* tb/receive-pack-code-cleanup:
builtin/receive-pack.c: remove redundant 'if'
| 3846c2a1edce72534cfd8b621e777dded5bd58a6 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3846c2a1edce72534cfd8b621e777dded5bd58a6 | 2022-05-25 16:42:49-07:00 |
t4045: make hash-size independent
Replace a hard-coded all-zeros object ID with a use of $ZERO_OID.
Signed-off-by: brian m. carlson <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| cf02be848698a00a68d4d5958f9b04bb6e40b526 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/cf02be848698a00a68d4d5958f9b04bb6e40b526 | 2019-10-28 00:59:06+00:00 |
commit-graph: fix corrupt upgrade from generation v1 to v2
The previous commit demonstrates a bug where a commit-graph using
generation v2 could enter a state where one of the GDA2 values has its
most-significant bit set (indicating that its value should be read from
the extended offset table in the GDO2 chunk) without having a GDO2 chunk
to read from.
This results in the following error message being displayed to the
caller:
fatal: commit-graph requires overflow generation data but has none
This bug arises in the following scenario:
- We decide to write a commit-graph using generation number v2, and
decide (correctly) that no GDO2 chunk is necessary (e.g., because
all of the commiter date offsets are no larger than 2^31-1).
- The v2 generation numbers are stored in the `->generation` member of
the commit slab holding `struct commit_graph_data`'s.
- Later on, `load_commit_graph_info()` is called, overwriting the
v2 generation data in the aforementioned slab with any existing v1
generation data.
Then, when the commit-graph code goes to write the GDA2 chunk via
`write_graph_chunk_generation_data()`, we use the overwritten generation
v1 data in a place where we expect to use a v2 generation number:
offset = commit_graph_data_at(c)->generation - c->date;
...because `commit_graph_data_at(c)->generation` used to hold the v2
generation data, but it was overwritten to contain the v1 generation
number via `load_commit_graph_info()`.
If the `offset` computation above overflows the v2 generation number
max, then `write_graph_chunk_generation_data()` will update its count of
large offsets and write the marker accordingly:
if (offset > GENERATION_NUMBER_V2_OFFSET_MAX) {
offset = CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW | num_generation_data_overflows;
num_generation_data_overflows++;
}
and reads will look for the GDO2 chunk containing the overflowing v2
generation number, *after* the commit-graph code decided that no such
chunk was necessary.
The main problem is that the slab containing `struct commit_graph_data`
has a dual purpose. It is used to hold data that we are about to write
to disk while generating a commit-graph, as well as hold data that was
read from an existing commit-graph.
When the two mix, namely when the result of reading the commit-graph has
a side-effect that mixes poorly with an in-progress commit-graph write,
we end up with corrupt data.
A complete fix might be to introduce a new slab that is used exclusively
for writing, and gate access between the two slabs based on context
provided by the caller (e.g., whether this computation is part of a
"read" or "write" operation).
But a more minimal fix addresses the only known path which overwrites
the slab data, which is `compute_bloom_filters()` ->
`get_or_compute_bloom_filter()` -> `load_commit_graph_info()` ->
`fill_commit_graph_info()` by avoiding the last call which clobbers the
data altogether.
This path only needs to learn the graph position of a given commit so
that it can be used in `load_bloom_filter_from_graph()`. By replacing
the last steps of the above with one that records the graph position
into a temporary variable which is then used to load the existing Bloom
data, we eliminate the clobbering, removing the corruption.
Signed-off-by: Taylor Blau <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 9550f6c16a8be18bd4868909d4d5e29d05bd9733 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/9550f6c16a8be18bd4868909d4d5e29d05bd9733 | 2022-07-12 19:10:33-04:00 |
l10n: Updated Bulgarian translation of git (2477t,0f,0u)
Signed-off-by: Alexander Shopov <[email protected]>
| aeef7d84f4882aa4946d8eaf9faaeada4133c8fd | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/aeef7d84f4882aa4946d8eaf9faaeada4133c8fd | 2015-12-13 18:55:45+02:00 |
branch: implement '--format' option
Implement the '--format' option provided by 'ref-filter'. This lets the
user list branches as per desired format similar to the implementation
in 'git for-each-ref'.
Add tests and documentation for the same.
Mentored-by: Christian Couder <[email protected]>
Mentored-by: Matthieu Moy <[email protected]>
Signed-off-by: Karthik Nayak <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3d9e4ce3ebef4f5aa47dad49f730e085f32b98da | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3d9e4ce3ebef4f5aa47dad49f730e085f32b98da | 2017-01-10 14:19:53+05:30 |
Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath' into maint
A small memory leak in an error codepath has been plugged in xdiff
code.
* rj/xdiff-prepare-plug-leak-on-error-codepath:
xdiff/xprepare: fix a memory leak
xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
| 183ecc3e49dee55de349e2f0759aa4894b3623c7 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/183ecc3e49dee55de349e2f0759aa4894b3623c7 | 2016-04-14 18:57:45-07:00 |
trace2 docs: a couple of grammar fixes
Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 3188d3c0b9a9e7029183cff86743b5a7ae9902dc | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/3188d3c0b9a9e7029183cff86743b5a7ae9902dc | 2022-05-03 10:26:42+00:00 |
fetch-pack: check for shallow if depth given
When a repository is first fetched as a shallow clone, either by
git-clone or by fetching into an empty repo, the server's capabilities
are not currently consulted. The client will send shallow requests even
if the server does not understand them, and the resulting error may be
unhelpful to the user. This change pre-emptively checks so we can exit
with a helpful error if necessary.
Signed-off-by: Mike Edgar <[email protected]>
Reviewed-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| eb86a507a150b8fbb34fb4e59bf9edbefbbad778 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/eb86a507a150b8fbb34fb4e59bf9edbefbbad778 | 2015-06-17 07:48:14-04:00 |
http: release strbuf on disabled alternates
This likely has no real-world impact on memory usage,
but it is cleaner for future readers.
Fixes: abcbdc03895f ("http: respect protocol.*.allow=user for http-alternates")
Signed-off-by: Eric Wong <[email protected]>
Reviewed-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 5cae73d5d23ec109322948478a957e77d2733f94 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/5cae73d5d23ec109322948478a957e77d2733f94 | 2017-03-04 01:50:16+00:00 |
tag: fix typo in nested tagging hint
In eea9c1e78f (tag: advise on nested tags, 2019-04-04), tag was taught
to hint at the user if a nested tag is made. However, this message had a
typo and it said "The object referred to by your new is...", which was
missing a "tag" after "new". Fix this message by adding the "tag".
Signed-off-by: Denton Liu <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| a54b2ab345c4e50e2adfbdeab7d716f5be77a6b3 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/a54b2ab345c4e50e2adfbdeab7d716f5be77a6b3 | 2019-05-08 15:16:41-04:00 |
sparse-checkout: check for dirty status
The index-merge performed by 'git sparse-checkout' will erase any staged
changes, which can lead to data loss. Prevent these attempts by requiring
a clean 'git status' output.
Helped-by: Szeder Gábor <[email protected]>
Signed-off-by: Derrick Stolee <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| cff4e9138d8df45e3b6199171092ee781cdadaeb | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/cff4e9138d8df45e3b6199171092ee781cdadaeb | 2019-11-21 22:04:51+00:00 |
t7415: adjust test for dubiously-nested submodule gitdirs for v2.20.x
In v2.20.x, Git clones submodules recursively by first creating the
submodules' gitdirs and _then_ "updating" the submodules. This can lead
to the situation where the clone path is taken because the directory
(while it exists already) is not a git directory, but then the clone
fails because that gitdir is unexpectedly already a directory.
This _also_ works around the vulnerability that was fixed in "Disallow
dubiously-nested submodule git directories", but it produces a different
error message than the one expected by the test case, therefore we
adjust the test case accordingly.
Note: as the two submodules "race each other", there are actually two
possible error messages, therefore we have to teach the test case to
expect _two_ possible (and good) outcomes in addition to the one it
expected before.
Note: this workaround is only necessary for the v2.20.x release train;
The behavior changed again in v2.21.x so that the original test case's
expectations are met again.
Signed-off-by: Johannes Schindelin <[email protected]>
| 4cfc47de25be7be1cddb47dcfddab3f1f80e5c41 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/4cfc47de25be7be1cddb47dcfddab3f1f80e5c41 | 2019-12-04 10:06:08+01:00 |
git-p4: fix syncing file types with pattern
Example of pattern file type: text+k
Text filtered through the p4 pattern regexp must be converted from
string back to bytes, otherwise 'data' command for the fast-import
will receive extra invalid characters, followed by the fast-import
process error.
CC: Yang Zhao <[email protected]>
Signed-off-by: Daniel Levin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| 52fc4f195c93eb2b1d1edfae69079646d8c2ea99 | git | neuralsentry | 1 | https://github.com/git/git | https://github.com/git/git/commit/52fc4f195c93eb2b1d1edfae69079646d8c2ea99 | 2020-12-23 14:37:27+00:00 |
fsck: convert static functions to struct object_id
Convert two static functions to use struct object_id and parse_oid_hex,
instead of relying on harcoded 20 and 40-based constants.
Signed-off-by: brian m. carlson <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
| c54f5ca97075fcaa11841e80855d55e0af29ea72 | git | neuralsentry | 0 | https://github.com/git/git | https://github.com/git/git/commit/c54f5ca97075fcaa11841e80855d55e0af29ea72 | 2018-05-02 00:25:41+00:00 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.