mbox series

[v2,0/5] tests: mark as passing with SANITIZE=leak

Message ID 5650c4ed-cec0-d11e-4f68-1661b3638786@gmail.com (mailing list archive)
Headers show
Series tests: mark as passing with SANITIZE=leak | expand

Message

Rubén Justo June 16, 2023, 11:27 p.m. UTC
The goal in this series is to pass t3200 with SANITIZE=leak.

As a result of the fixes, other tests also pass.

This is the list of tests that no longer trigger any leak after this
series:

   + t1507-rev-parse-upstream.sh
   + t1508-at-combinations.sh
   + t1514-rev-parse-push.sh
   + t2027-checkout-track.sh
   + t3200-branch.sh
   + t3204-branch-name-interpretation.sh
   + t5404-tracking-branches.sh
   + t5517-push-mirror.sh
   + t5525-fetch-tagopt.sh
   + t6040-tracking-info.sh
   + t7508-status.sh

Each of the commits (except 5/5) fixes a leak.  They have no
dependencies on each other.  As a result, they can be reordered.

To review one leak, the commit can be moved to the tip or reverted.
E.g. to review: "branch: fix a leak in setup_tracking", this can
be used:

  $ git revert --no-edit HEAD~3
  $ make SANITIZE=leak test T=t3200-branch.sh

Also, each commit have a minimal script in the message that can be used
to reproduce the leak.

This is the second version of this series.  However, a subset of the
patches from the first version have already been merged to 'next'.
Therefore, those are not included here.

These are the rest of them, which address Peff's reviews.

Thanks.

Rubén Justo (5):
  rev-parse: fix a leak with --abbrev-ref
  branch: fix a leak in setup_tracking
  branch: fix a leak in cmd_branch
  config: fix a leak in git_config_copy_or_rename_section_in_file
  tests: mark as passing with SANITIZE=leak

 branch.c                              |  2 +-
 builtin/branch.c                      |  2 ++
 builtin/rev-parse.c                   |  5 ++++-
 config.c                              | 29 ++++++++++++++-------------
 t/t1507-rev-parse-upstream.sh         |  1 +
 t/t1508-at-combinations.sh            |  1 +
 t/t1514-rev-parse-push.sh             |  1 +
 t/t2027-checkout-track.sh             |  1 +
 t/t3200-branch.sh                     |  1 +
 t/t3204-branch-name-interpretation.sh |  1 +
 t/t5404-tracking-branches.sh          |  1 +
 t/t5517-push-mirror.sh                |  1 +
 t/t5525-fetch-tagopt.sh               |  1 +
 t/t6040-tracking-info.sh              |  1 +
 t/t7508-status.sh                     |  1 +
 15 files changed, 33 insertions(+), 16 deletions(-)

Comments

Junio C Hamano June 16, 2023, 11:45 p.m. UTC | #1
Rubén Justo <rjusto@gmail.com> writes:

> This is the second version of this series.  However, a subset of the
> patches from the first version have already been merged to 'next'.
> Therefore, those are not included here.
>
> These are the rest of them, which address Peff's reviews.

Thanks!
Jeff King June 17, 2023, 5:48 a.m. UTC | #2
On Sat, Jun 17, 2023 at 01:27:47AM +0200, Rubén Justo wrote:

> This is the second version of this series.  However, a subset of the
> patches from the first version have already been merged to 'next'.
> Therefore, those are not included here.
> 
> These are the rest of them, which address Peff's reviews.

These all look good to me. I'd probably have split the config.c refactor
into its own commit, but I don't think it's worth going back for.

Thanks Rubén for fixing these!

-Peff
Rubén Justo June 17, 2023, 6:35 a.m. UTC | #3
On 17/6/23 7:48, Jeff King wrote:
> These all look good to me. I'd probably have split the config.c refactor
> into its own commit

That's a good point.  I'll send the refactor when the dust settles,
along with a revision for the UNLEAK().

Thank you!