In 336226c259 (packfile.h: drop extern from function declarations,
2019-04-05), `extern` was removed from function declarations because
it's redundant. However, in 8434e85d5f (repack: refactor pack deletion
for future use, 2019-06-10), an `extern` was mistakenly included.
Remove this spurious `ext
In git-format-patch.txt, we were missing some key user information.
First of all, using the `--to` and `--cc` options don't override
`format.to` and `format.cc` variables, respectively. They add on to each
other. Document this.
In addition, document the special value of `--base=auto`.
Next, while
Currently, format-patch only puts "*** SUBJECT HERE ***" when a cover
letter is generated. However, it is already smart enough to be able to
populate the cover letter with the branch description so there's no
reason why it cannot populate the subject as well.
Teach format-patch the --infer-cover-s
In Git's tests, there is typically no space between the redirection
operator and the filename. Remove these spaces.
Since output is silenced when running without `-v` and debugging
output is useful with `-v`, remove redirections to /dev/null.
Change here-docs from `<<\EOF` to `<<-\EOF` so that th
We used to populate the subject of the cover letter generated by
git-format-patch with "*** SUBJECT HERE ***". However, if a user submits
multiple patchsets, they may want to keep a consistent subject between
rerolls.
If git-format-patch is run with `--infer-cover-letter` or
`format.inferCoverSubj
>>> "UB" == Uwe Brauer writes:
>>> "RA" == Rafael Ascensão writes:
>> You can achieve something close (on small repos, more on that later) with:
>> $ git log --graph --color \
>> --format='%C(auto)changeset: %h:%H%nuser: %an%ndate:
%ad%nsummary: %s%n' \
>> | git name-rev
>>> "RA" == Rafael Ascensão writes:
> You can achieve something close (on small repos, more on that later) with:
> $ git log --graph --color \
> --format='%C(auto)changeset: %h:%H%nuser: %an%ndate:
%ad%nsummary: %s%n' \
> | git name-rev --refs=$(git rev-parse --abbrev
On 2019-08-18 at 20:27:41, Eric Sunshine wrote:
> For safety, it would probably be a good idea to check the exit status
> of the 'sed' invocation in the for-loop:
>
> for i in "$1" "$2"
> do
> sed -e ... "$i" >"$i.compare" || return 1
> done &&
> ...
I'll do that.
> (Note
On Sun, Aug 18, 2019 at 3:21 PM brian m. carlson
wrote:
> Refactor out the hard-coded object IDs and use test_oid to provide
> values for both SHA-1 and SHA-256.
s/Refactor out/Factor out/
> Signed-off-by: brian m. carlson
On Sun, Aug 18, 2019 at 3:21 PM brian m. carlson
wrote:
> 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
This information is useful and not visible anywhere else, so show it.
Signed-off-by: Beat Bolli
Suggested-by: Johannes Schindelin
---
This applies on top of 'ab/pcre-jit-fixes', currently in pu.
grep.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/grep.c b/grep.c
index 9bc589720b
Instead of hard-coding the hash size, use the_hash_algo to look up the
hash size at runtime. Remove the #define constant which was used to
hold the hash length, since writing the expression with the_hash_algo
provide enough documentary value on its own.
Signed-off-by: brian m. carlson
---
midx.
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex.
Rename several variables to indicate that they can contain any hash.
Signed-off-by: brian m. carlson
---
builtin/receive-pack.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/receive-pack.c b
show-index uses a variety of hard-coded constants to enumerate the
values in pack indices. Switch these hard-coded constants to use
the_hash_algo or GIT_MAX_RAWSZ, as appropriate, and convert one instance
of an unsigned char array to struct object_id.
Signed-off-by: brian m. carlson
---
builtin
Switch a hard-coded 18 to be a reference to the_hash_algo. Rename the
sha1 parameter to be called hash instead.
Signed-off-by: brian m. carlson
---
sha1-lookup.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sha1-lookup.c b/sha1-lookup.c
index 796ab68da8..93d9af080
Replace the uses of sha1_to_hex in this function with hash_to_hex to
allow the use of SHA-256 as well. Rename a variable since it is no
longer limited to SHA-1.
Signed-off-by: brian m. carlson
---
rerere.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/rerere.c b/re
Switch various uses of GIT_SHA1_HEXSZ to reference the_hash_algo
instead.
Signed-off-by: brian m. carlson
---
connected.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/connected.c b/connected.c
index cd9b324afa..7cd3bc9979 100644
--- a/connected.c
+++ b/connected.c
@
This is the seventeenth and final object_id series. The patches mostly
switch sha1_to_hex to hash_to_hex, remove null_sha1 in favor of
null_oid, and replace some hard-coded constants (along with
GIT_SHA1_HEXSZ) to use the_hash_algo.
This series may downloaded from the normal places as "object-id-p
In this code path, we use sha1_to_hex to display the contents of a v1
pack index. While we plan to switch to v3 indices for SHA-256, the v1
pack indices still function, so to support both algorithms, switch
sha1_to_hex to hash_to_hex.
Signed-off-by: brian m. carlson
---
builtin/show-index.c | 2
Switch the remaining use of null_sha1 to null_oid.
Signed-off-by: brian m. carlson
---
builtin/worktree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index a5bb02b207..0c0df3b0b8 100644
--- a/builtin/worktree.c
+++ b/builtin/worktre
Switch several uses of GIT_SHA1_HEXSZ to the_hash_algo.
Signed-off-by: brian m. carlson
---
builtin/blame.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index b6534d4dea..5a0c0c2312 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
Instead of using GIT_SHA1_HEXSZ and hard-coded constants, switch to
using the_hash_algo.
Signed-off-by: brian m. carlson
---
builtin/replace.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 644b21ca8d..4b00f1d84e 100644
---
Convert several uses of GIT_SHA1_HEXSZ constants to be references to
the_hash_algo.
Signed-off-by: brian m. carlson
---
sequencer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 34ebf8ed94..4d25e79137 100644
--- a/sequencer.c
+++ b/sequ
Change struct wt_status to use struct object_id instead of an array of
unsigned char.
Signed-off-by: brian m. carlson
---
builtin/commit.c | 4 ++--
wt-status.c | 2 +-
wt-status.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.
All of the existing uses of null_sha1 can be converted into uses of
null_oid, so do so. Remove null_sha1 and is_null_sha1, and define
is_null_oid in terms of null_oid. This also has the additional benefit
of removing several uses of sha1_to_hex.
Signed-off-by: brian m. carlson
---
builtin/clon
Replace a use of sha1_to_hex with hash_to_hex so that this code works
with a hash algorithm other than SHA-1.
Signed-off-by: brian m. carlson
---
packfile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packfile.c b/packfile.c
index fc43a6c52c..52dea88997 100644
--- a/p
Convert the two separate patch-id implementations to use the_hash_algo
in their implementation.
Signed-off-by: brian m. carlson
---
builtin/patch-id.c | 11 ++-
diff.c | 46 +++---
diff.h | 2 +-
3 files changed, 30 inserti
Pack checksums always use the current hash algorithm in use, so switch
from sha1_to_hex to hash_to_hex.
Signed-off-by: brian m. carlson
---
pack-write.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pack-write.c b/pack-write.c
index 29d17a9bec..f0017beb9d 100644
---
Instead of hard-coding constants, use parse_oid_hex to compute a pointer
and use it in further parsing operations.
Signed-off-by: brian m. carlson
---
fetch-pack.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fetch-pack.c b/fetch-pack.c
index 65be043f2a..1f56b
Switch one use of a hard-coded 40 constant to use the_hash_algo.
Signed-off-by: brian m. carlson
---
config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config.c b/config.c
index 3900e4947b..b0f79aab21 100644
--- a/config.c
+++ b/config.c
@@ -1204,7 +1204,7 @@ static int
When faking a working tree commit, we read in lines from MERGE_HEAD into
a strbuf. Because the strbuf is NUL-terminated and get_oid_hex will
fail if it unexpectedly encounters a NUL, the check for the length of
the line is unnecessary. There is no optimization benefit from this
case, either, sinc
Signed-off-by: brian m. carlson
---
combine-diff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/combine-diff.c b/combine-diff.c
index 3e49f3bda8..d5c4d839dc 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -930,7 +930,7 @@ static void show_combined_header(struct combine_
Switch several hard-coded uses of the constant 40 to references to
the_hash_algo.
Signed-off-by: brian m. carlson
---
builtin/rev-parse.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index f8bbe6d47e..308c67e4fc 100644
--- a/b
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex so
this code works with other algorithms.
Signed-off-by: brian m. carlson
---
builtin/index-pack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 0d55f73b
The push cert code uses HMAC-SHA-1 to create a nonce. This is a secure
use of SHA-1 which is not affected by its collision resistance (or lack
thereof). However, it makes sense for us to use a better algorithm if
one is available, one which may even be more performant. Futhermore,
until we have
Use the_hash_algo when calling xwrite with a hex object ID so that the
proper amount of data is written.
Signed-off-by: brian m. carlson
---
builtin/repack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/repack.c b/builtin/repack.c
index 632c0c0a79..5830f796e0 10064
Instead of using GIT_SHA1_HEXSZ, use the_hash_algo so that the code is
hash size independent.
Signed-off-by: brian m. carlson
---
bisect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bisect.c b/bisect.c
index e87ac29a51..e81c91d02c 100644
--- a/bisect.c
+++ b/bisect.c
@@
Switch a use of the constant 40 and a use of GIT_SHA1_HEXSZ to use
the_hash_algo instead.
Signed-off-by: brian m. carlson
---
bundle.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bundle.c b/bundle.c
index b5d21cd80f..a85ed3f7bc 100644
--- a/bundle.c
+++ b/bundle.c
@@
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
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
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-
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
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-
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/
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.
There are approximately 75 remaining test patches (plus some additional
code changes) required fo
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
Refactor 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.s
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 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
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
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
---
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
>>> "RA" == Rafael Ascensão writes:
> You can achieve something close (on small repos, more on that later) with:
> $ git log --graph --color \
> --format='%C(auto)changeset: %h:%H%nuser: %an%ndate:
%ad%nsummary: %s%n' \
> | git name-rev --refs=$(git rev-parse --abbrev
You can achieve something close (on small repos, more on that later) with:
$ git log --graph --color \
--format='%C(auto)changeset: %h:%H%nuser: %an%ndate: %ad%nsummary:
%s%n' \
| git name-rev --refs=$(git rev-parse --abbrev-ref HEAD) --name-only --stdin
* changeset: 5fa0f52
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.
Changes from v3:
* Check for both addition and removal of .gitattributes files.
* Switch from "test_config" to "git config".
Changes from v2:
* Rename has_path_suffix to ends_with_path_comp
The previous patch made it possible to perform line-level filtering
during history traversal instead of in an expensive preprocessing
step, but it still requires some simpler preprocessing steps, notably
topo-ordering. However, nowadays we have commit-graphs storing
generation numbers, which make
Remove the unused fields 'status', 'arg_alloc', 'arg_nr' and 'args'
from 'struct line_log_data'. They were already part of the struct
when it was introduced in commit 12da1d1f6 (Implement line-history
search (git log -L), 2013-03-28), but as far as I can tell none of
them have ever been actually u
The current line-level log implementation performs a preprocessing
step in prepare_revision_walk(), during which the line_log_filter()
function filters and rewrites history to keep only commits modifying
the given line range. This preprocessing affects both responsiveness
and correctness:
- Git
None of the tests in 't4211-line-log.sh' really check which parent
object IDs are shown in the output, either implicitly as part of
"Merge: ..." lines [1] or explicitly via the '%p' or '%P' format
specifiers in a custom pretty format.
Add two tests to 't4211-line-log.sh' to check which parent obje
Line-level log performs a preprocessing step in
prepare_revision_walk(), during which it filters and rewrites history
to keep only commits modifying the given line range. This
preprocessing causes significant delay before the first commit is
shown, wastes CPU time when the user asks only for a few
Signed-off-by: SZEDER Gábor
---
contrib/completion/git-completion.bash | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index e087c4bf00..57f984340e 100644
--- a/contrib/completion/git-completion.bash
+++ b/contri
On 2019-08-18 at 13:53:28, Gaeseric Vandal wrote:
>
> This a is a clarification of an earlier post. I thought gitweb was the
> problem.
>
>
> The actual problem appears to be with /usr/libexec/git-core/git-http-backend.
>
> Gitweb provides a list to unauthenticated users of available repos
I was trying to run "make profile" on the master branch (commit
5fa0f5238b: "Git 2.23") and it died in the
$(MAKE) PROFILE=GEN perf
dies with:
cannot open test-results/p5302-pack-index.subtests: No such file or
directory at ./aggregate.perl line 153.
I presume that's becuase th
This a is a clarification of an earlier post. I thought gitweb was the
problem.
The actual problem appears to be with /usr/libexec/git-core/git-http-backend.
Gitweb provides a list to unauthenticated users of available repositories. I
don't need that function so I have removed that p
When using `git rebase --autostash ` and
the workarea is dirty, the active branch is incorrectly reset
to the rebase branch.
This test will check for such behavior.
Signed-off-by: Ben Wijen
---
t/t3420-rebase-autostash.sh | 9 +
1 file changed, 9 insertions(+)
diff --git a/t/t3420-re
The rebase --autostash incorrectly moved the current branch to orig_head, where
orig_head -- commit object name of tip of the branch before rebasing
It seems this was incorrectly taken over from git-legacy-rebase.sh
Signed-off-by: Ben Wijen
---
builtin/rebase.c| 18 ++---
I found an issue with git rebase --autostash with an dirty
worktree/index.
It seems the currently active branch is moved, which is not correct.
The following patches contain both a test and a fix.
Ben Wijen (2):
t3420: never change upstream branch
rebase.c: make sure current branch isn't mo
70 matches
Mail list logo