On Fri, Feb 23, 2018 at 4:35 AM, Johannes Schindelin
wrote:
> Changes since v3:
>
> - fixed a grammar error in "introduce the `merge` command"'s commit message.
>
> - fixed a couple of resource leaks in safe_append() and do_reset(), pointed
> out by Eric Sunshine.
>
The interdiff seems incorrec
Our "git diff" command supports running as a standalone tool. In this
code path, we try to hash the file content but after
18e2588e11 (sha1_file: switch uses of SHA-1 to the_hash_algo -
2018-02-01), there is a chance that the_hash_algo (required by
index_path) may still be uninitialized if no repos
After 454253f059 (builtin/index-pack: improve hash function abstraction
- 2018-02-01), index-pack uses the_hash_algo for hashing. If "git
index-pack" is executed without a repository, we do not know what hash
algorithm to be used and the_hash_algo in theory could be undefined.
Since there should b
By returning an R-value in the_hash_algo we make sure people can't
accidentally change hash algorithm with
the_hash_algo = &hash_algos[something];
and go with repo_set_hash_algo() instead. Of course they can still do
the_repository->hash_algo = ...
but that is more obvious and easily ca
This reverts commit e26f7f19b6c7485f04234946a59ab8f4fd21d6d1. The root
problem, git clone not setting up the_hash_algo, has been fixed in the
previous patch.
Since this is a dangerous move and could potentially break stuff after
release (and leads to workaround like the reverted commit), the
worka
There are many ways for any command to access a git repository:
- most of them will try to discover the .git dir via
setup_git_directory() and friends
- the server side programs already know where the repo is and prepare
with enter_repo()
- special commands that deal with repo creation (init
This is mostly for displaying the hash algorithm name when we report
errors. Printing "unknown" with '%s' is much better than '(null)' in
glibc printf version (and probably could crash if other implementations
do not check for NULL pointer)
Signed-off-by: Nguyễn Thái Ngọc Duy
---
sha1_file.c | 2
v3 refines v2 a bit more:
- fix configure typo (and stray words in commit message)
- use repo_set_hash_algo() instead of reassigning the_hash_algo
- compare hash algos by format_id
- catch NULL hash algo, report nicely and suggest GIT_HASH_FIXUP
The last point makes me much happier about keeping
> On 25 Feb 2018, at 04:41, Eric Sunshine wrote:
>
> On Sat, Feb 24, 2018 at 11:27 AM, wrote:
>> Whenever a data stream is declared to be UTF-16BE, UTF-16LE, UTF-32BE
>> or UTF-32LE a BOM must not be used [1]. The function returns true if
>> this is the case.
>>
>> [1] http://unicode.org/faq/
> On 25 Feb 2018, at 04:52, Eric Sunshine wrote:
>
> On Sat, Feb 24, 2018 at 11:27 AM, wrote:
>> If the endianness is not defined in the encoding name, then let's
>> be strict and require a BOM to avoid any encoding confusion. The
>> is_missing_required_utf_bom() function returns true if a req
9ba95ed23c (perf/run: update get_var_from_env_or_config() for
subsections) stopped setting a default value for GIT_PERF_REPEAT_COUNT
if no perf config file is present, because get_var_from_env_or_config
returns early in that case.
Fix it by setting the default value after calling this function. I
Running a test script with '-x' turns on 'set -x' tracing, the output
of which is normally sent to stderr. This causes a lot of
test failures, because many tests redirect and verify the stderr
of shell functions, most frequently that of 'test_must_fail'.
These issues were worked around somewhat in
Hi everyone,
I am trying to remove cat-file formatting part and reuse same
functionality from ref-filter.
I have a problem that cat-file sometimes needs to continue running
even if the request is broken, while in ref-filter we invoke die() in
many places everywhere during formatting process. I writ
On Wed, Feb 14 2018, Jonathan Nieder jotted:
> Ævar Arnfjörð Bjarmason wrote:
>
>> Change the two wrappers to load from CPAN (local OS) or our own copy
>> to do so via the same codepath.
>
> nit: I think with s/to load/that load/ this will be easier to read.
>
>> I added the Error.pm wrapper in 2
On Wed, Feb 14 2018, Jonathan Nieder jotted:
> Hi,
>
> Ævar Arnfjörð Bjarmason wrote:
>
>> The Git::Mail::Address file added in bd869f67b9 ("send-email: add and
>> use a local copy of Mail::Address", 2018-01-05) had the executable bit
>> set, this should not be the case with *.pm files, it breaks
On February 25, 2018 1:57 PM, Ævar Arnfjörð Bjarmason wrote:
> On Wed, Feb 14 2018, Jonathan Nieder jotted:
>
> > Ævar Arnfjörð Bjarmason wrote:
> >
> >> Change the two wrappers to load from CPAN (local OS) or our own copy
> >> to do so via the same codepath.
> >
> > nit: I think with s/to load/th
Addresses comments against v1, and ships with a new
NO_PERL_CPAN_FALLBACKS knob (thanks Todd!) which distributions can
turn on to not get our FromCPAN copies. Details below.
Todd Zullinger (1):
Makefile: add NO_PERL_CPAN_FALLBACKS knob
Some of this was split off into into my "perl: move the
per
The Git::Mail::Address file added in bd869f67b9 ("send-email: add and
use a local copy of Mail::Address", 2018-01-05) had the executable bit
set. That bit should not be set for *.pm files. It breaks nothing but
it is redundant and confusing as none of the other files have it and
these files are nev
The Net::SMTP and Net::Domain were both first released with perl
v5.7.3[1], since my d48b284183 ("perl: bump the required Perl version
to 5.8 from 5.6.[21]", 2010-09-24) we've depended on 5.8, so there's
no reason to conditionally require this anymore.
This conditional loading was initially added
Move the Git::Error and Git::Mail::Address wrappers to the
Git::LoadCPAN::Loader::* namespace, e.g. Git::LoadCPAN::Error. That
module will then either load Error from CPAN (if installed on the OS),
or use Git::FromCPAN::Error.
When I added the Error wrapper in 20d2a30f8f ("Makefile: replace
perl/M
In Perl the "use strict/warnings" pragmas are lexical, thus there's no
reason to do:
package Foo;
use strict;
package Bar;
use strict;
$x = 5;
To satisfy the desire that the undeclared $x variable will be spotted
at compile-time. It's enough to include the first "use strict".
Amend Git.pm to load the "warnings" pragma like the rest of the code
in perl/ in addition to the existing "strict" pragma. This is
considered the bare minimum best practice in Perl.
Ever since this code was introduced in b1edc53d06 ("Introduce
Git.pm (v4)", 2006-06-24) it's only been using "strict
The Error.pm shipped with Git as a fallback if there was no Error.pm
on the system was released in April 2006. There's been dozens of
releases since then, the latest at August 7, 2017. Let's update to
that.
I don't know of anything we need from this new release or which this
fixes. This change is
Since my d48b284183 ("perl: bump the required Perl version to 5.8 from
5.6.[21]", 2010-09-24), we've depended on 5.8, so there's no reason to
conditionally require File::Temp and File::Spec anymore. They were
first released with perl versions v5.6.1 and 5.00405, respectively.
This code was origina
Since my d48b284183 ("perl: bump the required Perl version to 5.8 from
5.6.[21]", 2010-09-24), we've depended on 5.8, so there's no reason to
conditionally require Digest::MD5 anymore. It was released with perl
v5.7.3[1]
The initial introduction of the dependency in
e9fdd74e53 ("gitweb: (gr)avatar
Move the CPAN modules that have lived under perl/Git/FromCPAN since my
20d2a30f8f ("Makefile: replace perl/Makefile.PL with simple make
rules", 2017-12-10) to perl/FromCPAN.
A subsequent change will teach the Makefile to only install these
copies of CPAN modules if a flag that distro packagers wou
Change the two wrappers that load from CPAN (local OS) or our own copy
to do so via the same codepath.
I added the Error.pm wrapper in 20d2a30f8f ("Makefile: replace
perl/Makefile.PL with simple make rules", 2017-12-10), and shortly
afterwards Matthieu Moy added a wrapper for Mail::Address in
bd86
From: Todd Zullinger
We include some perl modules which are not part of the core perl
install, as a convenience. This allows us to rely on those modules in
our perl-based tools and scripts without requiring users to install the
modules from CPAN or their operating system packages.
Users whose o
Update our copy of Mail::Address from 2.19 (Aug 22, 2017) to 2.20 (Jan
23, 2018). Like the preceding Error.pm update this is done simply to
keep up-to-date with upstream, and as can be shown from the diff
there's no functional changes.
The updated source was retrieved from
https://fastapi.metacpan
Before my 20d2a30f8f ("Makefile: replace perl/Makefile.PL with simple
make rules", 2017-12-10) on an OS package that removed the
private-Error.pm copy we carried around manually removing the OS's
Error.pm would yield:
$ git add -p
Can't locate Error.pm in @INC (you may need to install the
On Sat, Feb 24, 2018 at 11:28 AM, wrote:
> UTF supports lossless conversion round tripping and conversions between
> UTF and other encodings are mostly round trip safe as Unicode aims to be
> a superset of all other character encodings. However, certain encodings
> (e.g. SHIFT-JIS) are known to h
On Sun, Feb 25, 2018 at 2:46 PM, Ævar Arnfjörð Bjarmason
wrote:
> Since my d48b284183 ("perl: bump the required Perl version to 5.8 from
> 5.6.[21]", 2010-09-24), we've depended on 5.8, so there's no reason to
> conditionally require Digest::MD5 anymore. It was released with perl
> v5.7.3[1]
>
> T
On Sun, Feb 25, 2018 at 2:46 PM, Ævar Arnfjörð Bjarmason
wrote:
> The Net::SMTP and Net::Domain were both first released with perl
> v5.7.3[1], since my d48b284183 ("perl: bump the required Perl version
> to 5.8 from 5.6.[21]", 2010-09-24) we've depended on 5.8, so there's
> no reason to condition
On Sun, Feb 25, 2018 at 10:29:29AM +0700, Duy Nguyen wrote:
> When I set unknown hash algo here, I think some test failed
> mysteriously because it used rawsz field (which has value zero), it
> didn't match some expectation, the code went to the error handling
> path, which eventually failed with s
On Sun, Feb 25, 2018 at 06:18:34PM +0700, Nguyễn Thái Ngọc Duy wrote:
> v3 refines v2 a bit more:
>
> - fix configure typo (and stray words in commit message)
> - use repo_set_hash_algo() instead of reassigning the_hash_algo
> - compare hash algos by format_id
> - catch NULL hash algo, report nice
Make some limited use of the wildmatch() interface for "precompiling"
patterns, although the current implementation does not do this yet.
The main hot codepath in dir.c is not being touched yet, but some
other invocations where we repeatedly match the same glob against
multiple strings have been m
Add the scaffolding necessary for precompiling wildmatch()
patterns.
There is currently no point in doing this with the wildmatch()
function we have now, since it can't make any use of precompiling the
pattern.
But adding this interface and making use of it will make it easy to
refactor the wildm
My recently landed wildmatch test series was in preperation for some
more major wildmatch changes.
Here's another series that prepares for bigger changes in wildmatch,
it adds an interface to pre-compile the patterns. Right now there's no
point in doing this, and it's harmless since none of the co
There were several instances of 32 sprinkled throughout this file, all
of which were used for allocating a buffer to store the header of an
object. Introduce a constant, MAX_HEADER_LEN, for this purpose.
Note that this constant is slightly larger than required; the longest
possible header is 28 (
Convert the index_bulk_checkin function, and the static functions it
calls, to use pointers to struct object_id.
Signed-off-by: brian m. carlson
---
bulk-checkin.c | 18 +-
bulk-checkin.h | 2 +-
sha1_file.c| 2 +-
3 files changed, 11 insertions(+), 11 deletions(-)
diff --
Convert both the argument and the return value to be pointers to struct
object_id. Update the callers and their internals to deal with the new
type. Remove several temporaries which are no longer needed.
Signed-off-by: brian m. carlson
---
builtin/mktag.c | 7 ++-
cache.h | 8 +
Convert write_index_as_tree and write_cache_as_tree to use struct
object_id.
Signed-off-by: brian m. carlson
---
builtin/am.c | 8
builtin/merge.c | 2 +-
builtin/write-tree.c | 2 +-
cache-tree.c | 10 +-
cache-tree.h | 4 ++--
sequencer.c
This is the twelfth in a series of patches to convert various parts of
the code to struct object_id.
The primary changes here are to the sha1_file code, find_unique_abbrev,
and lookup_replace_object. Due to the circular nature of converting the
latter, there are several places where we briefly in
Convert the callback functions for read_tree_recursive to take a pointer
to struct object_id.
Signed-off-by: brian m. carlson
---
archive.c | 8
builtin/checkout.c | 4 ++--
builtin/log.c | 2 +-
builtin/ls-tree.c | 8
merge-recursive.c | 2 +-
tree.c
This is needed to convert parts of the cache-tree code.
Signed-off-by: brian m. carlson
---
builtin/write-tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index bd0a78aa3c..299a121531 100644
--- a/builtin/write-tree.c
++
Convert the remaining portions of cache-tree.c to use struct object_id.
Convert several instances of 20 to use the_hash_algo instead.
Signed-off-by: brian m. carlson
---
cache-tree.c | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/cache-tree.c b/c
Convert the remaining function, feed_object, to use struct object_id.
Signed-off-by: brian m. carlson
---
send-pack.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/send-pack.c b/send-pack.c
index 2112d3b27a..7350af8883 100644
--- a/send-pack.c
+++ b/send-pack.c
Convert the two members of this struct to be instances of struct
object_id. Adjust the various functions in this file accordingly.
Signed-off-by: brian m. carlson
---
replace_object.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/replace_object.c b/replace_o
Convert the write_archive_entry_fn_t type to use a pointer to struct
object_id. Convert various static functions in the tar and zip
archivers also.
Signed-off-by: brian m. carlson
---
archive-tar.c | 28 ++--
archive-zip.c | 16
archive.c | 12 ++
Signed-off-by: brian m. carlson
---
builtin/fsck.c | 2 +-
cache.h| 4 ++--
sha1_file.c| 10 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 9981db2263..57509a4eac 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -51
Convert read_object_with_reference to take pointers to struct object_id.
Update the internals of the function accordingly.
Signed-off-by: brian m. carlson
---
builtin/cat-file.c | 2 +-
builtin/grep.c | 4 ++--
builtin/pack-objects.c | 2 +-
cache.h| 4 ++--
fast-
Convert the internals of this function to use struct object_id. This is
one of the last remaining callers of read_sha1_file_extended that has
not been converted yet.
Signed-off-by: brian m. carlson
---
tree-walk.c | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
d
Convert the various open_istream variants to take a pointer to struct
object_id. Introduce a temporary, which will be removed later, to work
around the fact that lookup_replace_object still returns a pointer to
unsigned char.
Signed-off-by: brian m. carlson
---
streaming.c | 15 +--
Convert this struct to use a member of type object_id. Convert various
static functions as well.
Signed-off-by: brian m. carlson
---
builtin/index-pack.c | 34 +-
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/builtin/index-pack.c b/builtin/index
Signed-off-by: brian m. carlson
---
builtin/mktag.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/builtin/mktag.c b/builtin/mktag.c
index beb552847b..65bb41e3cd 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -18,13 +18,13 @@
/*
* We refuse to tag
Signed-off-by: brian m. carlson
---
packfile.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packfile.c b/packfile.c
index 7dbe8739d1..954e1fca11 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1095,13 +1095,13 @@ static int retry_bad_packed_offset(struct packed_git
*p
Convert this function to take a pointer to struct object_id and rename
it to assert_oid_type.
Signed-off-by: brian m. carlson
---
builtin/commit-tree.c | 2 +-
cache.h | 2 +-
commit.c | 2 +-
sha1_file.c | 8
4 files changed, 7 insertions(+), 7 dele
Convert convert.c to struct object_id. Add a use of the_hash_algo to
replace hard-coded constants and change a strbuf_add to a strbuf_addstr
to avoid another hard-coded constant.
Note that a strict conversion using the hexsz constant would cause
problems in the future if the internal and user-vis
Convert the declaration and definition of strbuf_add_unique_abbrev to
make it take a pointer to struct object_id. Predeclare the struct in
strbuf.h, as cache.h includes strbuf.h before it declares the struct,
and otherwise the struct declaration would have the wrong scope.
Apply the following sem
Convert find_unique_abbrev and find_unique_abbrev_r to each take a
pointer to struct object_id.
Signed-off-by: brian m. carlson
---
builtin/blame.c| 2 +-
builtin/branch.c | 2 +-
builtin/checkout.c | 6 +++---
builtin/describe.c | 4 ++--
builtin/log.c | 4 ++
Convert unpack_entry and read_object to use struct object_id.
---
packfile.c | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/packfile.c b/packfile.c
index 954e1fca11..e3b1db7dd5 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1452,7 +1452,7 @@ struct unpac
Convert struct object_request to use struct object_id by updating the
definition and applying the following semantic patch, plus the standard
object_id transforms:
@@
struct object_request E1;
@@
- E1.sha1
+ E1.oid.hash
@@
struct object_request *E1;
@@
- E1->sha1
+ E1->oid.hash
Signed-off-by: br
Convert sha1_object_info and sha1_object_info_extended to take pointers
to struct object_id and rename them to use "oid" instead of "sha1" in
their names. Update the declaration and definition and apply the
following semantic patch, plus the standard object_id transforms:
@@
expression E1, E2;
@@
Convert the remaining caller of sha1_object_info_extended to use struct
object_id. Introduce temporaries, which will be removed later, since
there is a dependency loop between sha1_object_info_extended and
lookup_replace_object_extended. This allows us to convert the code in a
piecemeal fashion i
Convert this file to use struct object_id. Modify one use of
get_sha1_hex into parse_oid_hex; this is safe since we get the data from
a strbuf.
Signed-off-by: brian m. carlson
---
builtin/mktree.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/bui
Convert this function to take a pointer to struct object_id and rename
it object_file_to_archive.
Signed-off-by: brian m. carlson
---
archive-tar.c | 2 +-
archive-zip.c | 4 ++--
archive.c | 10 +-
archive.h | 8
4 files changed, 12 insertions(+), 12 deletions(-)
di
Convert the sha1 member of this struct to be an array of struct
object_id instead. This change is needed to convert find_unique_abbrev.
Signed-off-by: brian m. carlson
---
builtin/ls-files.c | 2 +-
resolve-undo.c | 8
resolve-undo.h | 2 +-
3 files changed, 6 insertions(+), 6
Convert the remaining static functions to take pointers to struct
object_id.
Signed-off-by: brian m. carlson
---
builtin/notes.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/notes.c b/builtin/notes.c
index 39304ba743..08ab9d7130 100644
--- a/builtin/note
We were using the util pointer, which is a pointer to void, as an
unsigned char pointer. The pointer actually points to a struct
origin_data, which has a struct object_id as its first member, which in
turn has an unsigned char array as its first member, so this was valid.
Since we want to convert
Convert this function to take a pointer to struct object_id and rename
it check_object_signature. Introduce temporaries to convert the return
values of lookup_replace_object and lookup_replace_object_extended into
struct object_id.
The temporaries are needed because in order to convert
lookup_rep
Convert the various *_sha1 members to use struct object_id instead.
Signed-off-by: brian m. carlson
---
wt-status.c | 12 ++--
wt-status.h | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 98e558a70b..698fa1d42a 100644
--- a/wt-st
Signed-off-by: brian m. carlson
---
archive-tar.c | 2 +-
archive-zip.c | 2 +-
builtin/index-pack.c | 2 +-
builtin/pack-objects.c | 2 +-
sha1_file.c| 2 +-
streaming.c| 6 +++---
streaming.h| 2 +-
7 files changed, 9 insertions(+), 9 dele
Convert read_sha1_file to take a pointer to struct object_id and rename
it read_object_file. Do the same for read_sha1_file_extended.
Convert one use in grep.c to use the new function without any other code
change, since the pointer being passed is a void pointer that is already
initialized with
Convert get_tree_entry and find_tree_entry to take pointers to struct
object_id.
Signed-off-by: brian m. carlson
---
archive.c | 4 ++--
blame.c| 6 ++
builtin/rm.c | 2 +-
builtin/update-index.c | 2 +-
line-log.c | 3 +--
match-trees.
This is necessary in order to convert find_unique_abbrev.
Signed-off-by: brian m. carlson
---
ref-filter.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
index f9e25aea7a..9cbd92611c 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -73
On Sat, Feb 24, 2018 at 08:34:56PM -0500, Derrick Stolee wrote:
> In mark_parents_uninteresting(), we check for the existence of an
> object file to see if we should treat a commit as parsed. The result
> is to set the "parsed" bit on the commit.
>
> Modify the condition to only check has_object_
On Sun, Feb 25, 2018 at 08:30:48PM -0500, Jeff King wrote:
> > diff --git a/revision.c b/revision.c
> > index 5ce9b93..bc7def5 100644
> > --- a/revision.c
> > +++ b/revision.c
> > @@ -113,7 +113,8 @@ void mark_parents_uninteresting(struct commit *commit)
> > * it is popped nex
On Sat, Feb 24, 2018 at 04:18:36PM +0100, Lars Schneider wrote:
> > We always use the in-repo contents when generating 'diff'. I think
> > by "attribute to be used in diff", what you are reallying after is
> > to convert the in-repo contents to that encoding _BEFORE_ running
> > 'diff' on it. E.
Good Day,
I am Mr. Alfred Cheuk Yu Chow, the Director for Credit & Marketing
Chong Hing Bank, Hong Kong, Chong Hing Bank Centre, 24 Des Voeux Road
Central, Hong Kong. I have a business proposal of $38,980,369.00.
All confirmable documents to back up the claims will be made available
to you p
Good Day,
I am Mr. Alfred Cheuk Yu Chow, the Director for Credit & Marketing
Chong Hing Bank, Hong Kong, Chong Hing Bank Centre, 24 Des Voeux Road
Central, Hong Kong. I have a business proposal of $38,980,369.00.
All confirmable documents to back up the claims will be made available
to you p
Good Day,
I am Mr. Alfred Cheuk Yu Chow, the Director for Credit & Marketing Chong
Hing Bank, Hong Kong, Chong Hing Bank Center, 24 Des Voeux Road Central,
Hong Kong. I have a business proposal of $ 38,980,369.00.
All confirmable documents to back up the claims will be made available
to you p
81 matches
Mail list logo