git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Beat Bolli" <bb@drbeat.li>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Beat Bolli" <dev+git@drbeat.li>, "René Scharfe" <l.s.r@web.de>,
	"Elijah Newren" <newren@gmail.com>,
	"Philippe Blain" <levraiphilippeblain@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: [PATCH 00/22] avoid redundant pipelines
Date: Tue,  5 Mar 2024 22:24:59 +0100	[thread overview]
Message-ID: <20240305212533.12947-1-dev+git@drbeat.li> (raw)

As follow-up to [1], here's a series that eliminates redundant
pipelines, mostly under t/.

Spawning a process is notoriously slow on Windows, so this will improve
test performance.

1/22 to 14/22 remove redundant uses of "cat" where the shell handles
input redirection from a file or the command can take a file argument.

15/22 to 20/22 merge redundant uses of "grep" into the following "sed"
or "awk" command. Both of these are capable of filtering themselves. I'm
a bit on the fence about this part because readability suffers in some
cases. It was a fun exercise, though :-)

21/22 merges multiple "sed" calls into one and replaces a whole "cat |
grep | awk" construct with a single "awk" call and uses "sort -u"
instead of "sort | uniq".

22/22 finally is a bit of an outlier in that it replaces a subshell with
a shell compound command.

In the tests, I have completely arbitrarily separated the commits into
thousands blocks to keep the commits and their reviews manageable.

All tests that I was able to run still pass. I don't have p4 or cvs
installed.

[1] https://lore.kernel.org/git/20240216171046.927552-1-dev+git@drbeat.li/

Beat Bolli (22):
  doc: avoid redundant use of cat
  contrib/subtree/t: avoid redundant use of cat
  t/lib-cvs.sh: avoid redundant use of cat
  t/annotate-tests.sh: avoid redundant use of cat
  t/perf: avoid redundant use of cat
  t/t0*: avoid redundant uses of cat
  t/t1*: avoid redundant uses of cat
  t/t3*: avoid redundant uses of cat
  t/t4*: avoid redundant uses of cat
  t/t5*: avoid redundant uses of cat
  t/t6*: avoid redundant uses of cat
  t/t7*: avoid redundant use of cat
  t/t8*: avoid redundant use of cat
  t/t9*: avoid redundant uses of cat
  t/t1*: merge a "grep | sed" pipeline
  t/t3*: merge a "grep | awk" pipeline
  t/t4*: merge a "grep | sed" pipeline
  t/t5*: merge a "grep | sed" pipeline
  t/t8*: merge "grep | sed" pipelines
  t/t9*: merge "grep | sed" pipelines
  contrib/coverage-diff: avoid redundant pipelines
  git-quiltimport: avoid an unnecessary subshell

 Documentation/howto/update-hook-example.txt |  4 +--
 contrib/coverage-diff.sh                    |  9 ++----
 contrib/subtree/t/t7900-subtree.sh          |  2 +-
 git-quiltimport.sh                          |  2 +-
 t/annotate-tests.sh                         |  2 +-
 t/lib-cvs.sh                                |  4 +--
 t/perf/repos/inflate-repo.sh                |  2 +-
 t/t0002-gitfile.sh                          |  2 +-
 t/t0011-hashmap.sh                          |  2 +-
 t/t0028-working-tree-encoding.sh            |  4 +--
 t/t0204-gettext-reencode-sanity.sh          |  2 +-
 t/t1007-hash-object.sh                      |  6 ++--
 t/t1091-sparse-checkout-builtin.sh          |  2 +-
 t/t1509/prepare-chroot.sh                   |  2 +-
 t/t3200-branch.sh                           |  2 +-
 t/t3321-notes-stripspace.sh                 |  8 ++---
 t/t3920-crlf-messages.sh                    |  4 +--
 t/t4002-diff-basic.sh                       |  2 +-
 t/t4020-diff-external.sh                    |  2 +-
 t/t4150-am.sh                               |  2 +-
 t/t4205-log-pretty-formats.sh               |  2 +-
 t/t4301-merge-tree-write-tree.sh            |  8 ++---
 t/t5100-mailinfo.sh                         |  2 +-
 t/t5317-pack-objects-filter-objects.sh      |  2 +-
 t/t5401-update-hooks.sh                     |  2 +-
 t/t5534-push-signed.sh                      |  2 +-
 t/t6112-rev-list-filters-objects.sh         |  2 +-
 t/t6413-merge-crlf.sh                       |  4 +--
 t/t7704-repack-cruft.sh                     |  2 +-
 t/t8010-cat-file-filters.sh                 |  2 +-
 t/t8013-blame-ignore-revs.sh                | 28 ++++++++---------
 t/t9118-git-svn-funky-branch-names.sh       |  2 +-
 t/t9300-fast-import.sh                      | 10 +++---
 t/t9350-fast-export.sh                      |  4 +--
 t/t9400-git-cvsserver-server.sh             | 35 ++++++++++-----------
 t/t9802-git-p4-filetype.sh                  |  2 +-
 t/t9807-git-p4-submit.sh                    |  2 +-
 t/t9824-git-p4-git-lfs.sh                   |  4 +--
 38 files changed, 86 insertions(+), 94 deletions(-)

-- 
2.44.0



             reply	other threads:[~2024-03-05 21:41 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-05 21:24 Beat Bolli [this message]
2024-03-05 21:25 ` [PATCH 01/22] doc: avoid redundant use of cat Beat Bolli
2024-03-05 22:24   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 02/22] contrib/subtree/t: " Beat Bolli
2024-03-05 22:25   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 03/22] t/lib-cvs.sh: " Beat Bolli
2024-03-05 22:26   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 04/22] t/annotate-tests.sh: " Beat Bolli
2024-03-05 22:28   ` Junio C Hamano
2024-03-06  0:04     ` Rubén Justo
2024-03-06  0:26       ` Junio C Hamano
2024-03-06  0:38         ` Rubén Justo
2024-03-05 21:25 ` [PATCH 05/22] t/perf: " Beat Bolli
2024-03-05 22:29   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 06/22] t/t0*: avoid redundant uses " Beat Bolli
2024-03-05 21:25 ` [PATCH 07/22] t/t1*: " Beat Bolli
2024-03-05 21:25 ` [PATCH 08/22] t/t3*: " Beat Bolli
2024-03-05 21:25 ` [PATCH 09/22] t/t4*: " Beat Bolli
2024-03-06  0:49   ` Junio C Hamano
2024-03-06  1:08   ` Eric Sunshine
2024-03-06 20:58     ` Beat Bolli
2024-03-05 21:25 ` [PATCH 10/22] t/t5*: " Beat Bolli
2024-03-05 21:25 ` [PATCH 11/22] t/t6*: " Beat Bolli
2024-03-05 21:25 ` [PATCH 12/22] t/t7*: avoid redundant use " Beat Bolli
2024-03-05 21:25 ` [PATCH 13/22] t/t8*: " Beat Bolli
2024-03-05 21:25 ` [PATCH 14/22] t/t9*: avoid redundant uses " Beat Bolli
2024-03-05 22:52   ` Rubén Justo
2024-03-06  0:43     ` Junio C Hamano
2024-03-06  1:10       ` Rubén Justo
2024-03-05 21:25 ` [PATCH 15/22] t/t1*: merge a "grep | sed" pipeline Beat Bolli
2024-03-05 21:25 ` [PATCH 16/22] t/t3*: merge a "grep | awk" pipeline Beat Bolli
2024-03-06  0:55   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 17/22] t/t4*: merge a "grep | sed" pipeline Beat Bolli
2024-03-05 21:25 ` [PATCH 18/22] t/t5*: " Beat Bolli
2024-03-06  0:57   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 19/22] t/t8*: merge "grep | sed" pipelines Beat Bolli
2024-03-06  0:59   ` Junio C Hamano
2024-03-06  2:17     ` Todd Zullinger
2024-03-06 16:03       ` Junio C Hamano
2024-03-06 21:03       ` Beat Bolli
2024-03-06 21:47         ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 20/22] t/t9*: " Beat Bolli
2024-03-06  1:00   ` Junio C Hamano
2024-03-05 21:25 ` [PATCH 21/22] contrib/coverage-diff: avoid redundant pipelines Beat Bolli
2024-03-05 21:25 ` [PATCH 22/22] git-quiltimport: avoid an unnecessary subshell Beat Bolli
2024-03-05 22:55   ` Rubén Justo
2024-03-05 22:58 ` [PATCH 00/22] avoid redundant pipelines Rubén Justo
2024-03-05 23:51 ` Junio C Hamano
2024-03-15 19:45 ` [PATCH v2 " Beat Bolli
2024-03-15 19:45   ` [PATCH v2 01/22] doc: avoid redundant use of cat Beat Bolli
2024-03-15 19:45   ` [PATCH v2 02/22] contrib/subtree/t: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 03/22] t/lib-cvs.sh: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 04/22] t/annotate-tests.sh: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 05/22] t/perf: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 06/22] t/t0*: avoid redundant uses " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 07/22] t/t1*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 08/22] t/t3*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 09/22] t/t4*: " Beat Bolli
2024-03-16  1:34     ` Taylor Blau
2024-03-16  6:04       ` Junio C Hamano
2024-03-15 19:46   ` [PATCH v2 10/22] t/t5*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 11/22] t/t6*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 12/22] t/t7*: avoid redundant use " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 13/22] t/t8*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 14/22] t/t9*: avoid redundant uses " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 15/22] t/t1*: merge a "grep | sed" pipeline Beat Bolli
2024-03-15 19:46   ` [PATCH v2 16/22] t/t3*: merge a "grep | awk" pipeline Beat Bolli
2024-03-16  1:49     ` Taylor Blau
2024-03-16 10:09       ` Beat Bolli
2024-03-16 15:46         ` Taylor Blau
2024-03-15 19:46   ` [PATCH v2 17/22] t/t4*: merge a "grep | sed" pipeline Beat Bolli
2024-03-15 19:46   ` [PATCH v2 18/22] t/t5*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 19/22] t/t8*: merge "grep | sed" pipelines Beat Bolli
2024-03-15 19:46   ` [PATCH v2 20/22] t/t9*: " Beat Bolli
2024-03-15 19:46   ` [PATCH v2 21/22] contrib/coverage-diff: avoid redundant pipelines Beat Bolli
2024-03-15 19:46   ` [PATCH v2 22/22] git-quiltimport: avoid an unnecessary subshell Beat Bolli
2024-03-16  1:51   ` [PATCH v2 00/22] avoid redundant pipelines Taylor Blau
2024-03-16 18:06     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240305212533.12947-1-dev+git@drbeat.li \
    --to=bb@drbeat.li \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=levraiphilippeblain@gmail.com \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).