Signed-off-by: Mike Hommey
---
packfile.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
Note, I'm not sure this is the right place to do it.
diff --git a/packfile.c b/packfile.c
index fc43a6c52c..b0cb84adda 100644
--- a/packfile.c
+++ b/packfile.c
@@ -339,13 +339,16 @@ void
This is less error-prone than "void *" as the compiler now
detects invalid types being passed.
Signed-off-by: Eric Wong
---
attr.c | 2 +-
blame.c | 2 +-
builtin/describe.c | 2 +-
builtin/difftool.c | 6 +++---
builtin/fetch.c | 2 +-
config.c
This is a step towards removing the requirement for
hashmap_entry being the first field of a struct.
Signed-off-by: Eric Wong
---
diff.c | 19 ---
diffcore-rename.c | 11 +++
hashmap.c | 2 +-
hashmap.h | 12
This macro is popular within the Linux kernel for supporting
intrusive data structures such as linked lists, red-black trees,
and chained hash tables while allowing the compiler to do
type checking.
I intend to use this to remove the limitation of "hashmap_entry"
being location-dependent and to al
This is less error-prone than "void *" as the compiler now
detects invalid types being passed.
Signed-off-by: Eric Wong
---
builtin/fast-export.c | 2 +-
hashmap.c | 2 +-
hashmap.h | 2 +-
merge-recursive.c | 4 ++--
oidmap.c| 2 +-
refs.c
This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.
Signed-off-by: Eric Wong
---
attr.c| 2 +-
blame.c | 6 +++---
builtin/difftool.c| 5 +++--
builtin/fast-export.c | 2 +-
config.c | 2 +-
diff.c
Otherwise, the hashmap_entry.next field appears to remain
uninitialized, which can lead to problems when
add_lines_to_move_detection calls hashmap_add.
I found this through manual inspection when converting
hashmap_add callers to take "struct hashmap_entry *".
Signed-off-by: Eric Wong
---
diff.
This started out as yak-shaving exercise to introduce the
"container_of" macro to make hashmap more flexible and
less error-prone.
So far I've ended up finding and fixing two real bugs in
patches 1/11 and 2/11 which should be fast-tracked.
Patches 3-9 are straightforward safety fixes to prevent f
This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.
Signed-off-by: Eric Wong
---
blame.c| 2 +-
hashmap.c | 3 ++-
hashmap.h | 2 +-
merge-recursive.c | 2 +-
name-hash.c| 4 ++--
packfile.c | 2 +-
r
This hashmap_entry_init function is intended to take a
hashmap_entry struct pointer, not a hashmap struct pointer.
This was not noticed because hashmap_entry_init takes a "void *"
arg instead of "struct hashmap_entry *", and the hashmap struct
is larger and can be cast into a hashmap_entry struct
By renaming the "hash" field to "_hash", it's easy to spot
improper initialization of hashmap_entry structs which
can leave "hashmap_entry.next" uninitialized.
Signed-off-by: Eric Wong
---
builtin/fast-export.c | 5 +++--
hashmap.c | 9 +
hashmap.h
C compilers do type checking to make life easier for us. So
rely on that and update all hashmap_entry_init callers to take
"struct hashmap_entry *" to avoid future bugs while improving
safety and readability.
Signed-off-by: Eric Wong
---
attr.c | 4 ++--
blame.c
This is less error-prone than "const void *" as the compiler
now detects invalid types being passed.
Signed-off-by: Eric Wong
---
diff.c | 5 +++--
diffcore-rename.c | 2 +-
hashmap.c | 5 +++--
hashmap.h | 3 ++-
name-hash.c | 2 +-
The index field in the commit object is used to find the buffer
corresponding to that commit in the buffer_slab. Resetting it first
means free_commit_buffer is not going to free the right buffer.
Signed-off-by: Mike Hommey
---
commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
On Sun, Aug 25, 2019 at 02:18:18PM +0900, Mike Hommey wrote:
> When add_note is called multiple times with the same key/value pair, the
> leaf_node it creates is leaked by notes_tree_insert.
For completeness, since I realized it was missing:
Signed-off-by: Mike Hommey
Mike
Use $ZERO_OID instead of hard-coding a fixed size all-zeros object ID.
Signed-off-by: brian m. carlson
---
t/t4000-diff-format.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh
index 8de36b7d12..e5116a76a1 100755
--- a/t/t4000-
Replace references to several hard-coded object IDs with a variable
referring to the generated commit. Avoid matching on exact character
positions, which will be different depending on the hash in use. In the
test for a valid object ID, use an obviously invalid one from the lookup
table.
Signed-
Compute the object IDs used in the todo list instead of hard-coding
them.
Signed-off-by: brian m. carlson
---
t/t3430-rebase-merges.sh | 23 +++
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index 7b6c4847ad
Instead of hard-coding a fixed length invalid object ID in the test,
compute one using the lookup tables.
Signed-off-by: brian m. carlson
---
t/t3600-rm.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index 66282a720e..8c8cca5bfb 100755
---
Instead of hard-coding object IDs, compute them and use those in the
comparison. Note that the comparison code ignores the actual object
IDs, but does check that they're the right size, so computing them is
the easiest way to ensure that they are.
Signed-off-by: brian m. carlson
---
t/t4009-dif
Abstract away the SHA-1-specific constants by sanitizing diff output to
remove the index lines, since it's clear from the assertions in question
that we are not interested in the specific object IDs.
Signed-off-by: brian m. carlson
---
t/t3903-stash.sh | 32 ++--
1 fi
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes. Convert some single-line heredocs into inline
uses of echo now that they can be expressed succinctly.
Signed-off-by: brian m. carlson
---
t/t3306-notes-prune.sh | 45
Instead of hard-coding 40-character shell patterns, use grep to
determine if all of the paths have either zero or one levels of fanout,
as appropriate.
Note that the final test is implicitly dependent on the hash algorithm.
Depending on the algorithm in use, the fanout may or may not completely
co
This is the fifth series of test fixes for SHA-256 compatibility. It
consists of 15 patches fixing various tests from t3201 through t4009 and
has only test fixes: no test helper changes are included.
Changes from v1:
* Add sanity-checking to the sed invocation.
* Remove whitespace between redirec
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes. Move some invocations of test_commit around so
that we can compute the object IDs for these commits.
Compute several object IDs in the tests instead of using hard-coded
values so that the test works w
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes. Add a use of $EMPTY_TREE instead of a
hard-coded value. Remove a comment about hard-coded hashes which is no
longer applicable.
Signed-off-by: brian m. carlson
---
t/t3404-rebase-interactive.sh | 2
Factor out the hard-coded object IDs and use test_oid to provide values
for both SHA-1 and SHA-256.
Signed-off-by: brian m. carlson
---
t/t4002-diff-basic.sh | 367 +-
1 file changed, 258 insertions(+), 109 deletions(-)
diff --git a/t/t4002-diff-basic.sh
Adjust the test so that it computes variables for object IDs instead of
using hard-coded hashes.
Signed-off-by: brian m. carlson
---
t/t3201-branch-contains.sh | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
inde
This test uses a hard-coded object ID to ensure that the result of
cherry-pick --ff is correct. Use test_oid to make this work for both
SHA-1 and SHA-256.
Signed-off-by: brian m. carlson
---
t/t3506-cherry-pick-ff.sh | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/t/
The various short object IDs in the range-diff output differ between
hash algorithms. Use test_oid_cache to look up values for both SHA-1
and SHA-256.
Signed-off-by: brian m. carlson
---
t/t3206-range-diff.sh | 227 +++---
1 file changed, 167 insertions(+), 6
On Sat, Aug 24, 2019 at 4:27 AM Denton Liu wrote:
> In some cases, we were using a redirection operator to feed input into
> sed. However, since sed is capable of opening its own files and provides
> better error messages on IO failure, make sed open its own files instead
> of redirecting input in
When applying multiple patches with git am, or when rebasing using the
am backend, it's possible that one of our patches has updated a
gitattributes file. Currently, we cache this information, so if a
file in a subsequent patch has attributes applied, the file will be
written out with the attribute
We have a function to strip the path suffix from a commit, but we don't
have one to check for a path suffix. For a plain filename, we can use
basename, but that requires an allocation, since POSIX allows it to
modify its argument. Refactor strip_path_suffix into a helper function
and a new function
This series makes rebase --am honor the .gitattributes file for
subsequent patches when a patch changes it.
Note that there are two places we load attributes in ll-merge.c, but
this code only handles the one that git am uses. The two cannot be
unified because the one in ll_merge_marker_size inten
On 25/08/2019 10:12, Denton Liu wrote:
A common scenario is if a user is working on a topic branch and they
wish to make some changes to intermediate commits or autosquash, they
would run something such as
git rebase -i --onto master... master
in order to preserve the merge base. This i
On 25/08/2019 20:58, Albert Vaca Cintora wrote:
On Sun, Aug 25, 2019 at 7:54 PM Johannes Sixt wrote:
Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:
However, I'm sure that a large percentage of developers out there will
agree with me that having to use force (-f) to delete every cloned
repo
Hi Szeder,
On 25/08/2019 19:59, SZEDER Gábor wrote:
'git clean -fd' must not delete an untracked directory if it belongs
s/untracked//
I don't believe it should matter either way for a sub-module
(sub-directory).
to a different Git repository or worktree.
msybr split the assertion from the f
Hi Szeder,
On 25/08/2019 20:09, SZEDER Gábor wrote:
On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:
Hi Szeder,
On 25/08/2019 13:07, SZEDER Gábor wrote:
On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
Add the Microsoft .manifest pattern, and do n
Junio,
This patch hasn't got any comments, but it looks correct to me, and fit
for merging IMO.
I updated the commit subject from 'git-gui: Update...' to 'git-gui:
update...' to match with the style of other commit messages, as you
suggested in the other series.
You can pull the updated commi
On Sun, Aug 25, 2019 at 08:59:18PM +0200, SZEDER Gábor wrote:
> 'git clean -fd' must not delete an untracked directory if it belongs
> to a different Git repository or worktree. Unfortunately, if a
> '.gitignore' rule in the outer repository happens to match a file in a
> nested repository or work
On Sun, Aug 25, 2019 at 7:54 PM Johannes Sixt wrote:
>
> Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:
> > However, I'm sure that a large percentage of developers out there will
> > agree with me that having to use force (-f) to delete every cloned
> > repo is annoying, and even worse, it crea
In cc8fdaee1e (banned.h: mark sprintf() as banned, 2018-07-24), both
'sprintf()' and 'vsprintf()' were marked as banned functions. The
non-variadic macro to ban 'vsprintf' has a typo which says that
'sprintf', not 'vsprintf' is banned. The variadic version does not have
the same typo.
Fix this by
On Sun, Aug 25, 2019 at 02:20:32PM +0100, Philip Oakley wrote:
> Hi Szeder,
>
> On 25/08/2019 13:07, SZEDER Gábor wrote:
> >On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget
> >wrote:
> >>Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
> >>and 'Release' e
'git clean -fd' must not delete an untracked directory if it belongs
to a different Git repository or worktree. Unfortunately, if a
'.gitignore' rule in the outer repository happens to match a file in a
nested repository or worktree, then something goes awry and 'git clean
-fd' does delete the con
This is a reroll of [1] which is mostly equivalent to the original RFC
but rebased on top of ab/pcre-jit-fixes.
The first patch fixes an inconsistency from 685668faaa (grep: stop
using a custom JIT stack with PCRE v1, 2019-07-26) where NO_LIBPCRE1_JIT
will only affect versions of pcre1 >= 8.32, wh
e87de7cab4 ("grep: un-break building with PCRE < 8.32", 2017-05-25)
added a restriction for JIT support that is no longer needed after
pcre_jit_exec() calls were removed.
Reorganize the definitions in grep.h so that JIT support could be
detected early and NO_LIBPCRE1_JIT could be used reliably to
The code used both a macro and a variable to keep track if JIT
support was desired and relied on the fact that a non JIT
enabled library will ignore a request for JIT compilation
(as defined by the second parameter of the call to pcre_study)
Cleanup the multiple levels of macros used and call pcre
Am 23.08.19 um 22:43 schrieb Albert Vaca Cintora:
> However, I'm sure that a large percentage of developers out there will
> agree with me that having to use force (-f) to delete every cloned
> repo is annoying, and even worse, it creates the bad habit of always
> force-deleting everything.
IMO, t
Let warning() format the message instead of using an intermediate strbuf
for that. This is shorter, easier to read and avoids an allocation.
Signed-off-by: René Scharfe
---
trace2/tr2_dst.c | 9 ++---
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/trace2/tr2_dst.c b/trace2/tr
On Sun, Aug 25, 2019 at 1:59 PM Kevin Daudt wrote:
>
> On Fri, Aug 23, 2019 at 10:43:45PM +0200, Albert Vaca Cintora wrote:
> > Hi git folks,
> >
> > Honestly I'm not aware of the reason behind .git being read-only, but
> > I'm sure there is one.
> >
> > However, I'm sure that a large percentage o
Am 25.08.19 um 12:02 schrieb Mike Hommey:
> On Sun, Aug 25, 2019 at 04:10:55AM -0400, Jeff King wrote:
>> diff --git a/fast-import.c b/fast-import.c
>> index ee7258037a..1f9160b645 100644
>> --- a/fast-import.c
>> +++ b/fast-import.c
>> @@ -1763,7 +1763,6 @@ static int read_next_command(void)
>>
Append the strbuf buffer only after detaching it. There is no practical
difference here, as the strbuf is not empty and no strbuf_ function is
called between storing the pointer to the still attached buffer and
calling strbuf_detach(), so that pointer is valid, but make sure to
follow the standard
Hi Szeder,
On 25/08/2019 13:07, SZEDER Gábor wrote:
On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
and 'Release' entries at the top-level directory, to allow for
multiple projects (one per target
On 25/08/19 05:12AM, Denton Liu wrote:
> Before, can_fast_forward was written with an if-else statement. However,
> in the future, we may be adding more termination cases which would lead
> to deeply nested if statements.
>
> Refactor to use a goto tower so that future cases can be easily
> insert
strbuf_detach() has been returning a pointer to a buffer even for empty
strbufs since 08ad56f3f0 ("strbuf: always return a non-NULL value from
strbuf_detach", 2012-10-18). Use that feature in show_log() instead of
having it handle empty strbufs specially.
Signed-off-by: René Scharfe
---
The patc
Am 25.08.19 um 06:13 schrieb Mike Hommey:
> command_buf.buf is also stored in cmd_hist, so instead of
> strbuf_release, the current code uses strbuf_detach in order to
> "leak" the buffer as far as the strbuf is concerned.
Hmm.
> However, strbuf_detach does more than "leak" the strbuf buffer: it
On Fri, Aug 23, 2019 at 10:43:45PM +0200, Albert Vaca Cintora wrote:
> Hi git folks,
>
> Honestly I'm not aware of the reason behind .git being read-only, but
> I'm sure there is one.
>
> However, I'm sure that a large percentage of developers out there will
> agree with me that having to use for
On Mon, Jul 29, 2019 at 01:08:14PM -0700, Philip Oakley via GitGitGadget wrote:
> Add the Microsoft .manifest pattern, and do not anchor the 'Debug'
> and 'Release' entries at the top-level directory, to allow for
> multiple projects (one per target).
>
> Signed-off-by: Philip Oakley
> Signed-off
On 23/08/19 11:12PM, Bert Wesarg wrote:
> On Fri, Aug 23, 2019, 18:44 Pratyush Yadav wrote:
>
> > On 23/08/19 08:04AM, Bert Wesarg wrote:
> > > On Fri, Aug 23, 2019 at 12:51 AM Pratyush Yadav
> > wrote:
> > > >
> > > > On 22/08/19 03:34PM, Junio C Hamano wrote:
> > [...]
> > > as I'm the one who
On Sun, Aug 25, 2019 at 04:10:55AM -0400, Jeff King wrote:
> Fast-import's read_next_command() has somewhat odd memory ownership
> semantics for the command_buf strbuf. After reading a command, we copy
> the strbuf's pointer (without duplicating the string) into our cmd_hist
> array of recent comma
From: Ævar Arnfjörð Bjarmason
Add tests rebasing a linear branch topology to linear rebase tests
added in 2aad7cace2 ("add simple tests of consistency across rebase
types", 2013-06-06).
These tests are duplicates of two surrounding tests that do the same
with tags pointing to the same objects. R
A common scenario is if a user is working on a topic branch and they
wish to make some changes to intermediate commits or autosquash, they
would run something such as
git rebase -i --onto master... master
in order to preserve the merge base. This is useful when contributing a
patch series
Before, when we rebased with a --fork-point invocation where the
fork-point wasn't empty, we would be setting options.restrict_revision.
The fast-forward logic would automatically declare that the rebase was
not fast-forwardable if it was set. However, this was painting with a
very broad brush.
Re
From: Ævar Arnfjörð Bjarmason
Change "same head" introduced in the preceding commit to check whether
the rebase.c code lands in the can_fast_forward() case in, and thus
prints out an "is up to date" and aborts early.
In some of these cases we make it past that and to "rewinding head",
then do a
Before, when we had the following graph,
A---B---C (master)
\
D (side)
running 'git rebase --onto master... master side' would result in D
being always rebased, no matter what. However, the desired behavior is
that rebase should notice that this is fast-forwarda
When rebase is run on a branch that can be fast-forwarded, this should
automatically be done. Create test to ensure this behavior happens.
There are some cases that currently don't pass. The first case is where
a feature and master have diverged, running
"git rebase master... master" causes a full
Hi all, it's been a while but I guess now's a good time as any to
resurrect this topic. This is basically a resubmission of Ævar's WIP v8
but I fixed a couple of minor whitespace issues.
In addition, I opted to drop patches 9-13 from v8 since I don't think I
can do a good enough job polishing them
Signed-off-by: Denton Liu
---
t/t3431-rebase-fork-point.sh | 53
1 file changed, 53 insertions(+)
create mode 100755 t/t3431-rebase-fork-point.sh
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
new file mode 100755
index 00..
From: Ævar Arnfjörð Bjarmason
Add more stress tests for the can_fast_forward() case in
rebase.c. These tests are getting rather verbose, but now we can see
under --ff and --no-ff whether we skip work, or whether we're forced
to run the rebase.
These tests aren't supposed to endorse the status qu
Before, can_fast_forward was written with an if-else statement. However,
in the future, we may be adding more termination cases which would lead
to deeply nested if statements.
Refactor to use a goto tower so that future cases can be easily
inserted.
Signed-off-by: Denton Liu
---
builtin/rebase
Fast-import's read_next_command() has somewhat odd memory ownership
semantics for the command_buf strbuf. After reading a command, we copy
the strbuf's pointer (without duplicating the string) into our cmd_hist
array of recent commands. And then when we're about to read a new
command, we clear the
On Sat, Aug 24, 2019 at 05:49:52PM +, Giuseppe Crinò wrote:
> On Fri, Aug 23, 2019 at 10:29:00AM +0200, SZEDER Gábor wrote:
> > What I wonder is whether we really have to remove crud from the user
> > name if it comes from the configuration.
>
> Yes. If the primary use of removing crud is to r
We read each line of the fast-import stream into the command_buf strbuf.
When reading a commit, we parse a line like "encoding foo" by storing a
pointer to "foo", but not making a copy. We may then read an unbounded
number of other lines (e.g., one for each modified file in the commit),
each of whi
On Sun, Aug 25, 2019 at 02:57:48AM -0400, Jeff King wrote:
> And I think this is actually a real bug in the current code! We keep a
> pointer to the encoding string, which survives because of the history.
> But that history is bounded, and we could have an indefinite number of
> changed files in t
Am 25.08.19 um 01:09 schrieb Stefan Sperling:
> A tag object which lacks newlines won't be parsed correctly.
> Git fails to detect this error and crashes due to a NULL deref:
>
> $ git archive 1.0.0
> Segmentation fault (core dumped)
> $ git checkout 1.0.0
> Segmentation fault (core dumped)
> $
Go
On Sun, Aug 25, 2019 at 04:20:31PM +0900, Mike Hommey wrote:
> > I think this is stronger than just "most of the time". It's an invariant
> > for strbufs to have a NUL, so the only case where detaching isn't a noop
> > is the empty slopbuf case you mention.
>
> If it's an invariant, why does deta
On Sun, Aug 25, 2019 at 02:57:48AM -0400, Jeff King wrote:
> On Sun, Aug 25, 2019 at 01:13:48PM +0900, Mike Hommey wrote:
>
> > command_buf.buf is also stored in cmd_hist, so instead of
> > strbuf_release, the current code uses strbuf_detach in order to
> > "leak" the buffer as far as the strbuf i
On Sun, Aug 25, 2019 at 03:10:35AM -0400, Jeff King wrote:
> Curiously, I think the existing case a few lines below your patch is
> wrong, though:
>
> ret = combine_notes(&l->val_oid,
> &entry->val_oid);
> if (!ret && is_null_oid(&l->val_oid))
>
On Sun, Aug 25, 2019 at 02:18:18PM +0900, Mike Hommey wrote:
> When add_note is called multiple times with the same key/value pair, the
> leaf_node it creates is leaked by notes_tree_insert.
Makes sense.
> diff --git a/notes.c b/notes.c
> index 75c028b300..ec35f5b551 100644
> --- a/notes.c
> +++
79 matches
Mail list logo