This gets us rid of a write-only variable.
Signed-off-by: Rene Scharfe
---
refs/files-backend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index fec77744b4..ed00ddab1a 100644
--- a/refs/files-backend.c
+++
This allows us to get rid of several write-only variables.
Signed-off-by: Rene Scharfe
---
builtin/checkout.c | 3 +--
builtin/receive-pack.c | 3 +--
ref-filter.c | 7 ++-
reflog-walk.c | 6 ++
transport.c| 3 +--
wt-status.c
Taylor Blau writes:
> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index 2a9fcf713..2bd0c5da7 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -597,6 +597,9 @@ Acked-by: A U Thor
>
> EOF
>
> +unfold () {
Jeff King writes:
> This patch didn't apply for me on top of the others. I get:
>
> Applying: ref-filter.c: use trailer_opts to format trailers
> error: patch failed: ref-filter.c:178
> error: ref-filter.c: patch does not apply
> Patch failed at 0004 ref-filter.c: use
On Sun, 1 Oct 2017, Junio C Hamano wrote:
> "Robert P. J. Day" writes:
>
> > it's simply a matter of the forms not matching between the SYNOPSIS
> > and the DESCRIPTION sections. am i making sense?
>
> I think the whole thing is wrong and the root cause is because the
>
René Scharfe writes:
> This allows us to get rid of several write-only variables.
>
> Signed-off-by: Rene Scharfe
> ---
> builtin/checkout.c | 3 +--
> builtin/receive-pack.c | 3 +--
> ref-filter.c | 7 ++-
> reflog-walk.c | 6 ++
>
Ben Peart writes:
> I had accumulated the same set of changes with one addition of removing
> a duplicate "the" from a comment in the fsmonitor.h file:
>
> diff --git a/fsmonitor.h b/fsmonitor.h
> index 8eb6163455..0de644e01a 100644
> --- a/fsmonitor.h
> +++
There is no longer any need to allocate and leak a `struct lock_file`.
The previous patch addressed an instance where we needed a minor tweak
alongside the trivial changes.
Deal with the remaining instances where we allocate and leak a struct
within a single function. Change them to have the
A recent series allowed `struct lock_file`s to be freed [1], so I wanted
to get rid of the "simple" leaks of this kind. I found a couple of
lock-related cleanups along the way and it resulted in this series. It
feels a bit scary at eleven patches -- especially as this is about
locking -- but I
There is no longer any need to allocate and leak a `struct lock_file`.
Initialize it on the stack instead.
Instead of setting `lock = NULL` to signal that we have already rolled
back, and that we should not do any more work, check with
`is_lock_file_locked()`. Since we take the lock with
If `do_write_index(..., struct tempfile *, ...)` fails to close the
temporary file, it deletes it. This resets the pointer to NULL, but only
the pointer which is local to `do_write_index()`, not the pointer that
the caller holds. If the caller ever dereferences its pointer, we have
undefined
When `write_locked_index(..., lock, COMMIT_LOCK)` returns, the lockfile
might have been neither committed nor rolled back. This happens if the
call to `do_write_index()` early in `do_write_locked_index()` fails, or
if `write_shared_index()` fails.
Some callers obviously do not expect the lock to
Similar to a previous patch, we do not need to use `newfd` to signal
that we have a lockfile to clean up. We can just unconditionally call
`rollback_lock_file`. If we do not hold the lock, it will be a no-op.
Where we check `newfd` to decide whether we need to take the lock, we
can instead use
The next patches will tweak the behavior of this function. Document it
in order to establish a basis for those patches.
Signed-off-by: Martin Ågren
---
cache.h | 16
1 file changed, 16 insertions(+)
diff --git a/cache.h b/cache.h
index
`write_locked_index()` takes two flags: `COMMIT_LOCK` and `CLOSE_LOCK`.
At most one is allowed. But it is also possible to use no flag, i.e.,
`0`. But when `write_locked_index()` calls `do_write_index()`, the
temporary file, a.k.a. the lockfile, will be closed. So passing `0` is
effectively the
Forgot to cc the mailing list.
On Sun, Oct 01, 2017 at 09:23:23PM +0800, Yubin Ruan wrote:
> Suppose that I have such a history of commit locally:
>
> A --> B --> C --> D
>
> If I then add a few more commits locally
>
> A --> B --> C --> D --> E --> F --> G
>
> And then I do a rebase and
This is shorter, easier and makes the intent clearer.
Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.
Signed-off-by: Rene Scharfe
---
builtin/commit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c
2017-10-01 22:17 GMT+08:00 Kevin Daudt :
> Forgot to cc the mailing list.
>
> On Sun, Oct 01, 2017 at 09:23:23PM +0800, Yubin Ruan wrote:
>> Suppose that I have such a history of commit locally:
>>
>> A --> B --> C --> D
>>
>> If I then add a few more commits locally
>>
>> A --> B
On 09/29, Robert P. J. Day wrote:
>
> from the man page:
>
> "If the --include-untracked option is used, all untracked files are
> also stashed and then cleaned up with git clean, leaving the working
> directory in a very clean state. If the --all option is used instead
>
On Sun, 1 Oct 2017, Thomas Gummerer wrote:
> On 09/29, Robert P. J. Day wrote:
> >
> > from the man page:
> >
> > "If the --include-untracked option is used, all untracked files
> > are also stashed and then cleaned up with git clean, leaving the
> > working directory in a very clean state. If
Avoid a string copy to a static buffer by using strbuf_add_real_path()
instead of combining strbuf_addstr() and real_path().
Patch generated by Coccinelle and contrib/coccinelle/strbuf.cocci.
Signed-off-by: Rene Scharfe
---
path.c | 2 +-
1 file changed, 1 insertion(+), 1
Use strbuf_addstr() instead of strbuf_addf() for adding strings. That's
simpler and makes the intent clearer.
Patch generated by Coccinelle and contrib/coccinelle/strbuf.cocci;
adjusted indentation in refs/packed-backend.c manually.
Signed-off-by: Rene Scharfe
---
lookup_blob() etc. can return NULL if the referenced object isn't of the
expected type. In theory it's wrong to reference the object member in
that case. In practice it's OK because it's located at offset 0 for all
types, so the pointer arithmetic (NULL + 0) is optimized out by the
compiler.
Use the macro FREE_AND_NULL to release allocated objects and clear their
pointers. This is shorter and documents the intent better by combining
the two related operations into one.
Patch generated with Coccinelle and contrib/coccinelle/free.cocci.
Signed-off-by: Rene Scharfe
---
In preparation for adding consistent "%(trailers)" atom options to
`git-for-each-ref(1)`'s "--format" argument, change "%(trailers)" in
pretty.c to separate sub-arguments with a ",", instead of a ":".
Multiple sub-arguments are given either as "%(trailers:unfold,only)" or
On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day wrote:
>
> sorry for more pedantic nitpickery, but i'm trying to write a
> section on how to properly process mixtures of EOLs in git, and when i
> read "man git-config", everything seems to refer to Mac OS X and macOS
>
strbuf_addf() can be used to add a specific number of space characters
by using the format "%*s" with an empty string and specifying the
desired width. Use strbuf_addchars() instead as it's shorter, makes the
intent clearer and is a bit more efficient.
Signed-off-by: Rene Scharfe
Transformations that hide multiplications can end up with an pair of
parentheses that is no longer needed. E.g. with a rule like this:
@@
expression E;
@@
- E * 2
+ double(E)
... we might get a patch like this:
- x = (a + b) * 2;
+ x = double((a + b));
Add a pair of
Fill trailer_opts with "unfold" and "only" to match the sub-arguments
given to the "%(trailers)" atom. Then, let's use the filled trailer_opts
instance with 'format_trailers_from_commit' in order to format trailers
in the desired manner.
Signed-off-by: Taylor Blau
---
"'"- (single-quote) styled code fencing is no longer considered modern
within the "Documentation/" subtree.
In preparation for adding additional information to this section of
git-for-each-ref(1)'s documentation, update old-style code fencing to
use "`"-style fencing instead.
Signed-off-by:
We currently have one test for %(trailers) in `git-for-each-ref(1)`,
through "%(contents:trailers)". In preparation for more, let's add a few
things:
- Move the commit creation step to its own test so that it can be
re-used.
- Add a non-trailer to the commit's trailers to test that
Hi,
Attached is the fourth revision of my patch-set "Support %(trailers)
arguments in for-each-ref(1)".
It includes the following changes since v3:
* Teach unfold() to unfold multiple lines.
* Rebase patches to apply on top of master.
Thanks in advance, and thanks for all of your help
The documentation makes reference to 'contents:trailers' as an example
to dig the trailers out of a commit. 'trailers' is an unmentioned
alternative, which is treated as an alias of 'contents:trailers'.
Since 'trailers' is easier to type, prefer that as the designated way to
dig out trailers
The %(contents) atom takes a contents "field" as its argument. Since
"trailers" is one of those fields, extend contents_atom_parser to parse
"trailers"'s arguments when used through "%(contents)", like:
%(contents:trailers:unfold,only)
A caveat: trailers_atom_parser expects NULL when no
sorry for more pedantic nitpickery, but i'm trying to write a
section on how to properly process mixtures of EOLs in git, and when i
read "man git-config", everything seems to refer to Mac OS X and macOS
(and linux, of course) using for EOL, with very little mention of
what one does if faced
Stephan Beyer writes:
> Having a .clang-format file in a project can be understood in a way that code
> has to be in the style defined by the .clang-format file, i.e., you just have
> to run clang-format over all code and you are set. This is not the case in the
> Git project,
Am 01.10.2017 um 21:29 schrieb Bryan Turner:
On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day wrote:
sorry for more pedantic nitpickery, but i'm trying to write a
section on how to properly process mixtures of EOLs in git, and when i
read "man git-config",
Use the macro ALLOC_ARRAY to allocate an array. This is shorter and
eaasier, as it automatically infers the size of elements.
Patch generated with Coccinelle and contrib/coccinelle/array.cocci.
Signeg-off-by: Rene Scharfe
---
run-command.c | 2 +-
1 file changed, 1 insertion(+),
On Mon, Oct 02, 2017 at 12:06:38AM +0800, Yubin Ruan wrote:
> 2017-10-01 22:17 GMT+08:00 Kevin Daudt :
> > Forgot to cc the mailing list.
> >
> > On Sun, Oct 01, 2017 at 09:23:23PM +0800, Yubin Ruan wrote:
> >> Suppose that I have such a history of commit locally:
> >>
> >> A --> B
Add some UNLEAKs where we are about to return from `cmd_*`. UNLEAK the
variables in the same order as we've declared them. While addressing
`msg` in builtin/tag.c, convert the existing `strbuf_release()` calls as
well.
Signed-off-by: Martin Ågren
---
builtin/checkout.c
Suppose that I have such a history of commit locally:
A --> B --> C --> D
If I then add a few more commits locally
A --> B --> C --> D --> E --> F --> G
And then I do a rebase and squash F and G into one single commit H.
What side effect will this rebase have? How will this affect "git push
strbuf_addf() can be used with "%.*s" to add a buffer of a specific size
to a strbuf, but the resulting code is longer, may require casting the
length to int and is less efficient than simply calling strbuf_add().
Add Coccinelle rules for transforming calls of the former type to the
latter.
On 25 September 2017 at 18:08, Jeff King wrote:
> On Sun, Sep 24, 2017 at 09:59:28PM +0200, Martin Ågren wrote:
>
>> > I'm not sure of the best way to count things.
>>
>
> But at least on the topic of "how many unique leaks are there", I wrote
> the script below to try to give some
Having a .clang-format file in a project can be understood in a way that code
has to be in the style defined by the .clang-format file, i.e., you just have
to run clang-format over all code and you are set. This is not the case in the
Git project, which is now reflected by a comment in the
GREETINGS,
My name is Carlos Slim Helu, A philanthropist the CEO and Chairman of the
Carlos Slim Helu Foundation Charitable Foundation, one of the largest private
foundations in the world. I believe strongly in‘giving while living’ I had one
idea that never changed in my mind — that you
We have two users of `struct apply_state` and the related functionality
in apply.c. Each user sets up its `apply_state` by handing over a
pointer to its static `lock_file`. (Before 076aa2cbd (tempfile:
auto-allocate tempfiles on heap, 2017-09-05), we could never free
lockfiles, so making them
After we have taken the lock using `LOCK_DIE_ON_ERROR`, we know that
`newfd` is non-negative. So when we check for exactly that property
before calling `write_locked_index()`, the outcome is guaranteed.
If we write and commit successfully, we set `newfd = -1`, so that we can
later avoid calling
Commit 83a3069a3 (lockfile: do not rollback lock on failed close,
2017-09-05) forgot to update the documentation by the function definition
to reflect that the lock is not rolled back in case closing fails.
Signed-off-by: Martin Ågren
---
lockfile.h | 4 ++--
1 file
The function has always been documented as returning 0 or -1. It is in
fact `void`. Correct that. As part of the rearrangements we lose the
mention that `delete_tempfile()` might set `errno`. Because there is
no return value, the user can't really know whether it did anyway.
Signed-off-by: Martin
Taylor Blau writes:
> A caveat: trailers_atom_parser expects NULL when no arguments are given
> (see: `parse_ref_filter_atom`). This is because string_list_split (given
> a maxsplit of -1) returns a 1-ary string_list* containing the given
> string if the delimiter could not be
On Mon, Oct 02, 2017 at 09:11:50AM +0900, Junio C Hamano wrote:
> > diff --git a/pretty.c b/pretty.c
> > index 94eab5c89..eec128bc1 100644
> > --- a/pretty.c
> > +++ b/pretty.c
> > @@ -1056,6 +1056,25 @@ static size_t parse_padding_placeholder(struct
> > strbuf *sb,
> > return 0;
> > }
> >
Hi,
Attached is the sixth revision of my patch-set "Support %(trailers)
arguments in for-each-ref(1)".
In includes the following changes since v5:
* Added an additional patch to change t4205 to harden `unfold()`
against multi-line trailer folding.
* Added a missing parameter call in
On Sun, Oct 01, 2017 at 04:56:03PM +0200, Martin Ågren wrote:
> There is no longer any need to allocate and leak a `struct lock_file`.
> The previous patch addressed an instance where we needed a minor tweak
> alongside the trivial changes.
>
> Deal with the remaining instances where we allocate
On Mon, Oct 02, 2017 at 08:55:53AM +0900, Junio C Hamano wrote:
> Taylor Blau writes:
>
> > "'"- (single-quote) styled code fencing is no longer considered modern
> > within the "Documentation/" subtree.
> >
> > In preparation for adding additional information to this section
Taylor Blau writes:
> In preparation for adding consistent "%(trailers)" atom options to
> `git-for-each-ref(1)`'s "--format" argument, change "%(trailers)" in
> pretty.c to separate sub-arguments with a ",", instead of a ":".
>
> Multiple sub-arguments are given either as
Looks good to me, thanks.
Taylor Blau writes:
> +test_expect_success '%(trailers) rejects unknown trailers arguments' '
> + cat >expect <<-EOF &&
> + fatal: unknown %(trailers) argument: unsupported
> + EOF
> + test_must_fail git for-each-ref --format="%(trailers:unsupported)"
> 2>actual
Prathamesh Chavan writes:
>
> #define CB_OPT_QUIET (1<<0)
> +#define CB_OPT_CACHED(1<<1)
> +#define CB_OPT_RECURSIVE (1<<2)
Same comments on both naming and formatting.
> @@ -245,6 +250,53 @@ static char *get_submodule_displaypath(const char
On Sun, Oct 01, 2017 at 06:00:25PM +0900, Junio C Hamano wrote:
> Taylor Blau writes:
>
> > diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> > index 2a9fcf713..2bd0c5da7 100755
> > --- a/t/t6300-for-each-ref.sh
> > +++ b/t/t6300-for-each-ref.sh
> > @@ -597,6
On Sun, Oct 01, 2017 at 05:33:04PM -0700, Taylor Blau wrote:
> The %(contents) atom takes a contents "field" as its argument. Since
> "trailers" is one of those fields, extend contents_atom_parser to parse
> "trailers"'s arguments when used through "%(contents)", like:
>
>
On Sun, Oct 01, 2017 at 04:56:06PM +0200, Martin Ågren wrote:
> After we have taken the lock using `LOCK_DIE_ON_ERROR`, we know that
> `newfd` is non-negative. So when we check for exactly that property
> before calling `write_locked_index()`, the outcome is guaranteed.
>
> If we write and
On Sun, 1 Oct 2017, Johannes Sixt wrote:
> Am 01.10.2017 um 21:29 schrieb Bryan Turner:
> > On Sun, Oct 1, 2017 at 10:52 AM, Robert P. J. Day
> > wrote:
> > >
> > >sorry for more pedantic nitpickery, but i'm trying to write a
> > > section on how to properly process
Thomas Gummerer writes:
> This is fine when --include-untracked is specified first, as --all
> implies --include-untracked, but I guess the behaviour could be a bit
> surprising if --all is specified first and --include-untracked later
> on the command line.
>
> Changing
Taylor Blau writes:
> "'"- (single-quote) styled code fencing is no longer considered modern
> within the "Documentation/" subtree.
>
> In preparation for adding additional information to this section of
> git-for-each-ref(1)'s documentation, update old-style code fencing to
>
Hi,
Attached is the fifth revision of my patch-set "Support %(trailers)
arguments in for-each-ref(1)".
It includes the following changes since v4:
* Clarified "ref-filter.c: parse trailers arguments with %(contents)
atom" to include reasoning for passing NULL as "" empty string in
On 2 October 2017 at 05:49, Junio C Hamano wrote:
> Martin Ågren writes:
>
>> ... Instead, require that one of the
>> flags is set. Adjust documentation and the assert we already have for
>> checking that we don't have too many flags. Add a macro
On Sun, Oct 01, 2017 at 04:45:45PM +0200, René Scharfe wrote:
> strbuf_addf() can be used to add a specific number of space characters
> by using the format "%*s" with an empty string and specifying the
> desired width. Use strbuf_addchars() instead as it's shorter, makes the
> intent clearer
On Mon, Oct 02, 2017 at 01:05:07AM -0400, Jeff King wrote:
> On Sun, Oct 01, 2017 at 06:00:25PM +0900, Junio C Hamano wrote:
>
> > Taylor Blau writes:
> >
> > > diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> > > index 2a9fcf713..2bd0c5da7 100755
> > > ---
On Mon, Oct 02, 2017 at 01:03:51AM -0400, Jeff King wrote:
> On Sun, Oct 01, 2017 at 05:33:04PM -0700, Taylor Blau wrote:
>
> > The %(contents) atom takes a contents "field" as its argument. Since
> > "trailers" is one of those fields, extend contents_atom_parser to parse
> > "trailers"'s
On Sun, Oct 01, 2017 at 10:12:16PM -0700, Taylor Blau wrote:
> > Doh, that string_list behavior is what I was missing in my earlier
> > comments. I agree this is probably the best way of doing it. I'm tempted
> > to say that parse_ref_filter_atom() should do a similar thing. Right now
> > we've
On Mon, Oct 02, 2017 at 01:51:11PM +0900, Junio C Hamano wrote:
> Taylor Blau writes:
>
> > @@ -212,9 +212,10 @@ static void contents_atom_parser(const struct
> > ref_format *format, struct used_at
> > atom->u.contents.option = C_SIG;
> > else if (!strcmp(arg,
On Sun, Oct 01, 2017 at 04:56:04PM +0200, Martin Ågren wrote:
> Commit 83a3069a3 (lockfile: do not rollback lock on failed close,
> 2017-09-05) forgot to update the documentation by the function definition
> to reflect that the lock is not rolled back in case closing fails.
Oops, thanks for
On Sun, Oct 01, 2017 at 04:56:08PM +0200, Martin Ågren wrote:
> Similar to a previous patch, we do not need to use `newfd` to signal
> that we have a lockfile to clean up. We can just unconditionally call
> `rollback_lock_file`. If we do not hold the lock, it will be a no-op.
>
> Where we check
Hi,
Attached is a one-long patch series to un-distinguish between atoms
without sub-arguments ("%(refname)") and atoms with empty sub-argument
lists ("%(refname:)").
This addresses a user-experience issue that Peff points out:
> Doh, that string_list behavior is what I was missing in my earlier
"Robert P. J. Day" writes:
> ok, i'm going to have to digest all that; pretty sure someone else
> will need to change the man page to clarify the apparent inconsistency
> i was referring to:
>
> SYNOPSIS
>git checkout [-p|--patch] [] [--] [...]
> DESCRIPTION
>
We currently have one test for %(trailers) in `git-for-each-ref(1)`,
through "%(contents:trailers)". In preparation for more, let's add a few
things:
- Move the commit creation step to its own test so that it can be
re-used.
- Add a non-trailer to the commit's trailers to test that
In preparation for adding consistent "%(trailers)" atom options to
`git-for-each-ref(1)`'s "--format" argument, change "%(trailers)" in
pretty.c to separate sub-arguments with a ",", instead of a ":".
Multiple sub-arguments are given either as "%(trailers:unfold,only)" or
The documentation makes reference to 'contents:trailers' as an example
to dig the trailers out of a commit. 'trailers' is an unmentioned
alternative, which is treated as an alias of 'contents:trailers'.
Since 'trailers' is easier to type, prefer that as the designated way to
dig out trailers
Fill trailer_opts with "unfold" and "only" to match the sub-arguments
given to the "%(trailers)" atom. Then, let's use the filled trailer_opts
instance with 'format_trailers_from_commit' in order to format trailers
in the desired manner.
Signed-off-by: Taylor Blau
---
The %(contents) atom takes a contents "field" as its argument. Since
"trailers" is one of those fields, extend contents_atom_parser to parse
"trailers"'s arguments when used through "%(contents)", like:
%(contents:trailers:unfold,only)
A caveat: trailers_atom_parser expects NULL when no
"'"- (single-quote) styled code quoting is no longer considered modern
within the "Documentation/" subtree.
In preparation for adding additional information to this section of
git-for-each-ref(1)'s documentation, update old-style code quoting to
use "`"-style quoting instead.
Signed-off-by:
Prathamesh Chavan writes:
> Introduce function for_each_listed_submodule() and replace a loop
> in module_init() with a call to it.
>
> The new function will also be used in other parts of the
> system in later patches.
>
> Mentored-by: Christian Couder
On 2 October 2017 at 05:37, Junio C Hamano wrote:
> Martin Ågren writes:
>
> This is not a show-stopper for this patch series, but just something
> I noticed, something that used to be unavoidable in the old world
> order that requires us to leak
René Scharfe writes:
> lookup_blob() etc. can return NULL if the referenced object isn't of the
> expected type. In theory it's wrong to reference the object member in
> that case. In practice it's OK because it's located at offset 0 for all
> types, so the pointer arithmetic
On Sun, Oct 01, 2017 at 04:45:13PM +0200, René Scharfe wrote:
> lookup_blob() etc. can return NULL if the referenced object isn't of the
> expected type. In theory it's wrong to reference the object member in
> that case. In practice it's OK because it's located at offset 0 for all
> types, so
Signed-off-by: brian m. carlson
---
diff-lib.c | 4 ++--
dir.c | 8
read-cache.c | 6 +++---
unpack-trees.c | 8
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index 4e0980caa8..af4f1b7865
Convert update_ref, refs_update_ref, and write_pseudoref to use struct
object_id. Update the existing callers as well. Remove update_ref_oid,
as it is no longer needed.
Signed-off-by: brian m. carlson
---
bisect.c | 6 --
builtin/am.c
This is one of the last unconverted callers to peel_ref. While we're
fixing that, convert the rest of the file, since it will need to be
converted at some point anyway.
Signed-off-by: brian m. carlson
---
builtin/pack-objects.c | 131
Convert the callers and internals, including struct read_ref_at_cb, of
read_ref_at to use struct object_id.
Signed-off-by: brian m. carlson
---
builtin/show-branch.c | 5 ++---
refs.c| 34 +-
refs.h|
All of the callers already pass the hash member of struct object_id, so
update them to pass a pointer to the struct directly,
This transformation was done with an update to declaration and
definition and the following semantic patch:
@@
expression E1, E2, E3, E4;
@@
- resolve_refdup(E1, E2,
Convert several static functions to take pointers to struct object_id.
Change the relevant parameters to write_packed_entry to be const, as we
don't modify them. Rename lock_ref_sha1_basic to lock_ref_oid_basic to
reflect its new argument.
Signed-off-by: brian m. carlson
Convert the unsigned char * parameter to struct object_id * for
files_read_raw_ref and packed_read_raw-ref. Update the documentation.
Switch from using get_sha1_hex and a hard-coded 40 to using
parse_oid_hex.
Signed-off-by: brian m. carlson
---
refs.c
All but two of the call sites already had parameters using the hash
parameter of struct object_id, so convert them to take a pointer to the
struct directly. Also convert refs_read_refs_full, the underlying
implementation.
Signed-off-by: brian m. carlson
---
Convert peel_ref (and its corresponding backend) to struct object_id.
This transformation was done with an update to the declaration,
definition, and test helper and the following semantic patch:
@@
expression E1, E2;
@@
- peel_ref(E1, E2.hash)
+ peel_ref(E1, )
@@
expression E1, E2;
@@
-
Convert the remaining uses of unsigned char [20] to struct object_id.
This conversion is needed for dwim_log.
Signed-off-by: brian m. carlson
---
builtin/reflog.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git
All of the callers of these functions just pass the hash member of a
struct object_id, so convert them to use a pointer to struct object_id
directly.
Signed-off-by: brian m. carlson
---
archive.c | 2 +-
branch.c | 2 +-
Convert traverse_bitmap_commit_list and the callbacks it takes to use a
pointer to struct object_id.
Signed-off-by: brian m. carlson
---
builtin/pack-objects.c | 8
builtin/rev-list.c | 4 ++--
pack-bitmap.c | 8
pack-bitmap.h
Signed-off-by: brian m. carlson
---
builtin/reflog.c | 4 ++--
reflog-walk.c| 2 +-
refs.c | 8
refs.h | 2 +-
sha1_name.c | 2 +-
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/builtin/reflog.c
Convert these two functions and the functions that underlie them to take
pointers to struct object_id. This is a prerequisite to convert
resolve_gitlink_ref. Fix a stray tab in the middle of the index_mem
call in index_pipe by converting it to a space.
Signed-off-by: brian m. carlson
Convert delete_ref and refs_delete_ref to take a pointer to struct
object_id. Update the documentation accordingly, including referring to
null_oid in lowercase, as it is not a #define constant.
Signed-off-by: brian m. carlson
---
builtin/branch.c | 2 +-
1 - 100 of 139 matches
Mail list logo