Jeff King writes:
> If $GITHEAD_1234abcd is set in the environment, we use its value as a
> "better branch name" in generating conflict markers. However, we pick
> these better names early in the process, and the return value from
> getenv() is not guaranteed to stay valid.
>
> Let's make a copy
Jeff King writes:
> We pass the result of getenv("GIT_DIR") to init_db() and assume that the
> string remains valid. But that's not guaranteed across calls to setenv()
> or even getenv(), although it often works in practice. Let's make a copy
> of the string so that we follow the rules.
>
> Note
Jeff King writes:
> We save the result of $GIT_INDEX_FILE so that we can restore it after
> setting it to a new value and running add--interactive. However, the
> pointer returned by getenv() is not guaranteed to be valid after calling
> setenv(). This _usually_ works fine, but can fail if libc n
Jeff King writes:
> The return value of getenv() is not guaranteed to remain valid across
> multiple calls (nor across calls to setenv()). Since this function
> caches the result for the length of the program, we must make a copy to
> ensure that it is still valid when we need it.
>
> Reported-by
Kim Gybels writes:
> According to getenv(3)'s notes:
>
> The implementation of getenv() is not required to be reentrant. The
> string pointed to by the return value of getenv() may be statically
> allocated, and can be modified by a subsequent call to getenv(),
> putenv(3), seten
Jeff King writes:
> This was a minor cleanup I mentioned in:
>
> https://public-inbox.org/git/20181122173109.gi28...@sigill.intra.peff.net/
>
> but didn't get picked up.
Yeah, that does sound vaguely familiar ;-) Thanks, will queue.
>
> remote.c | 4 ++--
> 1 file changed, 2 insertions(+),
Signed-off-by: Nguyễn Thái Ngọc Duy
---
merge-recursive.c | 45 -
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 28f44c73ec..a596d95739 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@
This kills the_index dependency in get_oid_with_context() but for
get_oid() and friends, they still assume the_repository (which also
means the_index).
Unfortunately the widespread use of get_oid() will make it hard to
make the conversion now. We probably will add repo_get_oid() at some
point and
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/am.c | 2 +-
builtin/checkout.c| 2 +-
builtin/merge-recursive.c | 2 +-
builtin/merge.c | 2 +-
merge-recursive.c | 148 --
merge-recursive.h | 6 +-
seque
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/commit.c | 2 +-
builtin/describe.c | 2 +-
builtin/diff.c | 2 +-
builtin/rebase.c | 5 ++---
cache.h| 6 --
read-cache.c | 14 --
repository.h | 6 ++
wt-status.c| 2 +-
8 files ch
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/am.c | 6 +++---
cache.h | 6 +++---
merge-recursive.c | 2 +-
read-cache.c | 12 +---
4 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/builtin/am.c b/builtin/am.c
index 611712dc95..a9ffc92eaa 100644
--
>From now on, by default index compat macros are off because they could
hide the_index dependency. Only those in builtin can use it (and even
so should be avoided if possible).
Signed-off-by: Nguyễn Thái Ngọc Duy
---
attr.c | 1 -
builtin/add.c
read_index() shares the same problem as hold_locked_index(): it
assumes $GIT_DIR/index. Move all call sites to repo_read_index()
instead. read_index_preload() and read_index_unmerged() are also
killed as a consequence.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
apply.c | 2 +-
blame.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/am.c | 2 +-
builtin/commit.c | 2 +-
builtin/notes.c | 21 +
notes-merge.c| 4 ++--
notes-utils.c| 17 ++---
notes-utils.h| 11 ---
sequencer.c | 7 ---
sequencer.h | 3 ++-
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/checkout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 08b0ac48f3..1b672a9fd9 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -284,7 +284,7 @@ static int checkout_path
hold_locked_index() assumes the index path at $GIT_DIR/index. This is
not good for places that take an arbitrary index_state instead of
the_index, which is basically everywhere except builtin/.
Replace it with repo_hold_locked_index(). hold_locked_index() remains
as a wrapper around repo_hold_lock
This command is probably the first one that operates on a repository
other than the_repository, in f9ee2fcdfa (grep: recurse in-process
using 'struct repository' - 2017-08-02). An explicit 'struct
repository *' was added in that commit to pass around the repository
that we're supposed to grep from.
v2 fixes Martin's comment in 2/10 and also includes a new patch about
grep_opt->repo that was sent and reviewed during rc time [1]. It's kind
of the same topic so I include it here instead of resending it
separately.
[1] https://public-inbox.org/git/20181118163851.32178-1-pclo...@gmail.com/
Range
"Derrick Stolee via GitGitGadget" writes:
> From: Derrick Stolee
>
> When enumerating objects to place in a pack-file during 'git
> pack-objects --revs', we discover the "frontier" of commits
> that we care about and the boundary with commit we find
> uninteresting. From that point, we walk tree
"Derrick Stolee via GitGitGadget" writes:
> From: Derrick Stolee
>
> When creating a pack-file using 'git pack-objects --revs' we provide
> a list of interesting and uninteresting commits. For example, a push
> operation would make the local topic branch be interesting and the
> known remote ref
"Derrick Stolee via GitGitGadget" writes:
> From: Derrick Stolee
>
> Add a '--sparse' option flag to the pack-objects builtin. This
> allows the user to specify that they want to use the new logic
> for walking trees. This logic currently does not differ from the
> existing output, but will in a
Subsequent patches will change how the output of pack-objects is
processed, so extract that processing into its own function.
Currently, at most 1 character can be buffered (in the "buffered" local
variable). One of those patches will require a larger buffer, so replace
that "buffered" local varia
The current C Git implementation expects Git servers to follow a
specific order of sections when transmitting protocol v2 responses, but
this is not explicit in the documentation. Make the order explicit.
Signed-off-by: Jonathan Tan
---
Documentation/technical/protocol-v2.txt | 18 --
Currently, a response to a fetch request has sideband support only while
the packfile is being sent, meaning that the server cannot send notices
until the start of the packfile.
Extend sideband support in protocol v2 fetch responses to the whole
response. upload-pack will advertise it if the
uploa
Define a GIT_TEST_SIDEBAND_ALL environment variable meant to be used
from tests. When set to true, this overrides uploadpack.allowsidebandall
to true, allowing the entire test suite to be run as if this
configuration is in place for all repositories.
As of this patch, all tests pass whether GIT_TE
This is a partial implementation of upload-pack sending part of its
packfile response as URIs.
The client is not fully implemented - it knows to ignore the
"packfile-uris" section, but because it does not actually fetch those
URIs, the returned packfile is incomplete. A test is included to show
th
This is on ms/packet-err-check.
This is a follow-up of my earlier work to allow partial CDN offloading
of fetch v2 response packfiles, which had the issue of having to buffer
(or suspend) progress and keepalive messages because we didn't have
sideband until the packfile section started (as I wrote
Signed-off-by: Jonathan Tan
---
Documentation/technical/packfile-uri.txt | 83
Documentation/technical/protocol-v2.txt | 6 +-
2 files changed, 88 insertions(+), 1 deletion(-)
create mode 100644 Documentation/technical/packfile-uri.txt
diff --git a/Documentation/techn
It will be convenient for a future patch if writing options
(specifically, whether the written data is to be multiplexed) could be
controlled from a single place, so create struct packet_writer to serve
as that place, and modify upload-pack to use it.
Currently, it only stores the output fd, but a
A subsequent patch will teach struct packet_reader a new field that, if
set, instructs it to interpret read data as multiplexed. This will
create a dependency from pkt-line to sideband.
To avoid a circular dependency, split recv_sideband() into 2 parts: the
reading loop (left in recv_sideband()) a
If $GITHEAD_1234abcd is set in the environment, we use its value as a
"better branch name" in generating conflict markers. However, we pick
these better names early in the process, and the return value from
getenv() is not guaranteed to stay valid.
Let's make a copy of the returned string. And to
The value returned by getenv() is not guaranteed to remain valid across
other environment function calls. But in between our call and using the
value, we run fill_textconv(), which may do quite a bit of work,
including spawning sub-processes.
We can make this safer by calling getenv() right before
We pass the result of getenv("GIT_DIR") to init_db() and assume that the
string remains valid. But that's not guaranteed across calls to setenv()
or even getenv(), although it often works in practice. Let's make a copy
of the string so that we follow the rules.
Note that we need to mark it with UN
We save the result of $GIT_INDEX_FILE so that we can restore it after
setting it to a new value and running add--interactive. However, the
pointer returned by getenv() is not guaranteed to be valid after calling
setenv(). This _usually_ works fine, but can fail if libc needs to
reallocate the envir
cmd_config() points our source filename pointer at the return value of
getenv(), but that value may be invalidated by further calls to
environment functions. Let's copy it to make sure it remains valid.
We don't need to bother freeing it, as it remains part of the
whole-process global state until
The return value of getenv() is not guaranteed to remain valid across
multiple calls (nor across calls to setenv()). Since this function
caches the result for the length of the program, we must make a copy to
ensure that it is still valid when we need it.
Reported-by: Yngve N. Pettersen
Signed-of
Similar to the recent:
https://public-inbox.org/git/20190109221007.21624-1-kgyb...@infogroep.be/
there are some other places where we do not follow the POSIX rule that
getenv()'s return value may be invalidated by other calls to getenv() or
setenv().
For the most part we haven't noticed becaus
On 1/11/2019 3:25 PM, Junio C Hamano wrote:
Junio C Hamano writes:
So, I assumed that the implementation was wrong, but it is the other
way around. You do mean to pick only already uninteresting trees
out of "set" and mark its reachables.
One thing that would make me worried is what help the
The Linux kernel receives many patches to the devicetree files each
release. The hunk header for those patches typically show nothing,
making it difficult to figure out what node is being modified without
applying the patch or opening the file and seeking to the context. Let's
add a builtin 'dts' p
According to getenv(3)'s notes:
The implementation of getenv() is not required to be reentrant. The
string pointed to by the return value of getenv() may be statically
allocated, and can be modified by a subsequent call to getenv(),
putenv(3), setenv(3), or unsetenv(3).
Since str
Junio C Hamano writes:
>> In preparation for a new algorithm that walks fewer trees when
>> creating a pack from a set of revisions, create a method that
>> takes an oidset of tree oids and marks reachable objects as
>> UNINTERESTING.
>> ...
>> There is one new assumption in this approach: we are
"Derrick Stolee via GitGitGadget" writes:
> From: Derrick Stolee
>
> In preparation for a new algorithm that walks fewer trees when
> creating a pack from a set of revisions, create a method that
> takes an oidset of tree oids and marks reachable objects as
> UNINTERESTING.
>
> The current imple
When parsing url.foo.insteadOf, we call make_rewrite() and only then
check to make sure the value is a string (and return an error if it
isn't). This isn't quite a leak, because the struct we allocate is part
of a global array, but it does leave a funny half-finished struct.
In practice, it doesn'
On Fri, Jan 11, 2019 at 10:03:01AM -0800, Junio C Hamano wrote:
> SZEDER Gábor writes:
>
> > On Thu, Jan 10, 2019 at 01:22:00PM -0800, Junio C Hamano wrote:
> >> Ævar Arnfjörð Bjarmason writes:
> >> ...
> >> > I.e. is this another case where we're blindly fixing bugs but should
> >> > just re-i
Hi Junio,
A small update...
On Mon, Jan 7, 2019 at 12:39 PM Elijah Newren wrote:
> On Mon, Jan 7, 2019 at 12:11 PM Junio C Hamano wrote:
> > Junio C Hamano writes:
> >
> > > Elijah Newren writes:
> > >
> > >> On Tue, Dec 11, 2018 at 8:11 AM Elijah Newren wrote:
> > >>>
> > >>> This series co
SZEDER Gábor writes:
> On Thu, Jan 10, 2019 at 01:22:00PM -0800, Junio C Hamano wrote:
>> Ævar Arnfjörð Bjarmason writes:
>> ...
>> > I.e. is this another case where we're blindly fixing bugs but should
>> > just re-import upstream's code instead?
>>
>> Good point. I am inclined to queue the
Jiang Xin writes:
> Junio C Hamano 于2019年1月11日周五 上午5:11写道:
>>
>> Jiang Xin writes:
>>
>> > From: Jiang Xin
>> > +create_commits()
>> > +{
>>
>> Style (see Documentation/CodingGuidelines).
>
> OK, parenthese after function name.
>>
>> > +create_pack_1()
>> > +{
>> > + P1=$(cd .git/objects/p
Issac Trotts writes:
> Sounds good. Btw, did you queue it yet? I didn't see it at the mirror:
> https://github.com/git/git/commits/master.
No patch goes to 'master' directly.
Once we see that a patch is in reviewable shape during the mailing
list discussion, we wait for a few more days and un
Issac Trotts writes:
> On Tue, Jan 8, 2019 at 2:21 PM Junio C Hamano wrote:
>>
>> issac.tro...@gmail.com writes:
>>
>> > From: Issac Trotts
>>
>> Heh, I'll edit this line to match S-o-b: below.
>
> Thanks. Otherwise I have to set up git send-email again on my work laptop.
This in-body From: li
Jeff King writes:
> On Thu, Jan 10, 2019 at 01:01:36PM -0800, Junio C Hamano wrote:
>
>> > diff --git a/builtin/gc.c b/builtin/gc.c
>> > index 871a56f1c5..df90fd7f51 100644
>> > --- a/builtin/gc.c
>> > +++ b/builtin/gc.c
>> > @@ -659,8 +659,10 @@ int cmd_gc(int argc, const char **argv, const char
On Thu, Jan 10, 2019 at 01:01:36PM -0800, Junio C Hamano wrote:
> > diff --git a/builtin/gc.c b/builtin/gc.c
> > index 871a56f1c5..df90fd7f51 100644
> > --- a/builtin/gc.c
> > +++ b/builtin/gc.c
> > @@ -659,8 +659,10 @@ int cmd_gc(int argc, const char **argv, const char
> > *prefix)
> >
> >
On Thu, Jan 10, 2019 at 09:48:42PM +, Samir Benmendil wrote:
> > If the user wants to work in a different repository, the
> > environments that tells Git about the original repository can be
> > unset to do so, which is a very much deliberately designed
> > behaviour, primarily to help those w
On Thu, Jan 10, 2019 at 02:19:51PM -0800, Junio C Hamano wrote:
> > I know "--follow" is a bit hacky in general, but I think there are other
> > cases where log_tree_diff() may decide not to show a commit (maybe
> > without --root, though I guess that's the default these days).
> >
> > I dunno. Ce
On Fri, Jan 11, 2019 at 09:51:06AM -0500, Jeff King wrote:
> I think rewrite_here needs to be a direct pointer into the buffer, since
> we plan to modify it.
>
> I think rewrite_with is correct to be an object_id. It's either the oid
> passed in from the caller, or the subtree we generated (in wh
On Thu, Jan 10, 2019 at 11:55:51PM +, brian m. carlson wrote:
> > I think the only reason they are "struct object_id" is because that's
> > what tree_entry_extract() returns. Should we be providing another
> > function to allow more byte-oriented access?
>
> The reason is we recursively call
On Fri, Jan 11, 2019 at 12:17:50AM +, brian m. carlson wrote:
> > I think this is really the only safe and sane solution. We resisted it
> > because of the cost of the extra copies (especially the
> > update_tree_entry() one). But I don't know that anybody actually
> > measured it. Do you have
On 20-Dec-18 1:34 PM, Johannes Schindelin wrote:
From: "Slavica Đukić via GitGitGadget"
This is the first version of a patch series to start porting
git-add--interactive from Perl to C. Daniel Ferreira's patch series used as
a head start:
https://public-inbox.org/git/1494907234-28903-1-git-se
Hi Lars,
I see occasional failures in the test 'required process filter should
filter data' in 't0021-conversion.sh', added in edcc85814c (convert:
add filter..process option, 2016-10-16); most often in the
macOS Travis CI build jobs, but it's an OS-independent timing issue.
That's an enormous te
Hi Markus,
On Wed, 9 Jan 2019, Markus Wiederkehr wrote:
> On Wed, Jan 9, 2019 at 3:05 PM Johannes Schindelin
> wrote:
> >
> > Having said that, it is an unintended regression in the built-in rebase.
> > Markus, could you come up with a minimal test case, preferably in the form
> > of a patch to
59 matches
Mail list logo