From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Thorsten Scherer <t.scherer@eckelmann.de>
Subject: [ptxdist] [PATCH 3/3] git-ptx-patches: Simplify nested if construct
Date: Wed, 29 Nov 2023 10:37:47 +0100 [thread overview]
Message-ID: <20231129093743.906378-4-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20231129093743.906378-1-u.kleine-koenig@pengutronix.de>
Instead of
if A; then
...
else
if B; then
...
else
...
fi
fi
use the more compact
if A; then
...
elif B; then
...
else
...
fi
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
scripts/git-ptx-patches | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/scripts/git-ptx-patches b/scripts/git-ptx-patches
index 56e82eb2ee56..b27dbe7905d9 100755
--- a/scripts/git-ptx-patches
+++ b/scripts/git-ptx-patches
@@ -235,11 +235,9 @@ while read patch para; do
if grep -q "$patch" .ptxdist/series.auto; then
# ok, this is one of the patches we just touched
:
+ elif grep -q "$patch" .ptxdist/series.{0,1}; then
+ echo "Base patch \"$patch\"!"
else
- if grep -q "$patch" .ptxdist/series.{0,1}; then
- echo "Base patch \"$patch\"!"
- else
- echo "Old patch \"$patch\"!"
- fi
+ echo "Old patch \"$patch\"!"
fi
done | sort
--
2.42.0
next prev parent reply other threads:[~2023-11-29 9:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 9:37 [ptxdist] [PATCH 0/3] git-ptx-patches: A fix and two minor improvements Uwe Kleine-König
2023-11-29 9:37 ` [ptxdist] [PATCH 1/3] git-ptx-patches: Fix a race condition Uwe Kleine-König
2023-11-30 6:09 ` Thorsten Scherer
2023-12-07 11:09 ` [ptxdist] [APPLIED] " Michael Olbrich
2023-11-29 9:37 ` [ptxdist] [PATCH 2/3] git-ptx-patches: Open .ptxdist/series less often for writing Uwe Kleine-König
2023-12-07 11:09 ` [ptxdist] [APPLIED] " Michael Olbrich
2023-11-29 9:37 ` Uwe Kleine-König [this message]
2023-12-07 11:09 ` [ptxdist] [APPLIED] git-ptx-patches: Simplify nested if construct Michael Olbrich
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231129093743.906378-4-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=ptxdist@pengutronix.de \
--cc=t.scherer@eckelmann.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox