* [PATCH] scripts/tags: merge "TAGS" and "tags" in case
@ 2021-11-03 15:35 Zhaoyu Liu
2021-11-26 15:58 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Zhaoyu Liu @ 2021-11-03 15:35 UTC (permalink / raw)
To: gregkh, masahiroy, ripxorip, zackary.liu.pro, mpe; +Cc: linux-kernel
merge "TAGS" and "tags" for the code more concise
Signed-off-by: Zhaoyu Liu <zackary.liu.pro@gmail.com>
---
scripts/tags.sh | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 16d475b3e203..a9181dd0fee2 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -315,15 +315,11 @@ case "$1" in
dogtags
;;
- "tags")
- rm -f tags
- xtags ctags
- remove_structs=y
- ;;
-
- "TAGS")
- rm -f TAGS
- xtags etags
+ "TAGS" | "tags")
+ rm -f $1
+ xtags $([ $1 = "tags" ] \
+ && echo ctags \
+ || echo etags)
remove_structs=y
;;
esac
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts/tags: merge "TAGS" and "tags" in case
2021-11-03 15:35 [PATCH] scripts/tags: merge "TAGS" and "tags" in case Zhaoyu Liu
@ 2021-11-26 15:58 ` Greg KH
2021-11-27 1:33 ` Zackary Liu
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-11-26 15:58 UTC (permalink / raw)
To: Zhaoyu Liu; +Cc: masahiroy, ripxorip, mpe, linux-kernel
On Wed, Nov 03, 2021 at 11:35:29PM +0800, Zhaoyu Liu wrote:
> merge "TAGS" and "tags" for the code more concise
>
> Signed-off-by: Zhaoyu Liu <zackary.liu.pro@gmail.com>
> ---
> scripts/tags.sh | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index 16d475b3e203..a9181dd0fee2 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -315,15 +315,11 @@ case "$1" in
> dogtags
> ;;
>
> - "tags")
> - rm -f tags
> - xtags ctags
> - remove_structs=y
> - ;;
> -
> - "TAGS")
> - rm -f TAGS
> - xtags etags
> + "TAGS" | "tags")
> + rm -f $1
> + xtags $([ $1 = "tags" ] \
> + && echo ctags \
> + || echo etags)
> remove_structs=y
> ;;
Ick, that's much harder to read and understand.
What is wrong with the existing code? It's obvious and makes sense, it
is not duplicating any lines here except the one "remove_structs=y"
which is fine.
I'm not going to take this, sorry.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scripts/tags: merge "TAGS" and "tags" in case
2021-11-26 15:58 ` Greg KH
@ 2021-11-27 1:33 ` Zackary Liu
0 siblings, 0 replies; 3+ messages in thread
From: Zackary Liu @ 2021-11-27 1:33 UTC (permalink / raw)
To: Greg KH; +Cc: masahiroy, ripxorip, mpe, linux-kernel
On Nov 26 2021, at 11:58 pm, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Nov 03, 2021 at 11:35:29PM +0800, Zhaoyu Liu wrote:
>> merge "TAGS" and "tags" for the code more concise
>>
>> Signed-off-by: Zhaoyu Liu <zackary.liu.pro@gmail.com>
>> ---
>> scripts/tags.sh | 14 +++++---------
>> 1 file changed, 5 insertions(+), 9 deletions(-)
>>
>> diff --git a/scripts/tags.sh b/scripts/tags.sh
>> index 16d475b3e203..a9181dd0fee2 100755
>> --- a/scripts/tags.sh
>> +++ b/scripts/tags.sh
>> @@ -315,15 +315,11 @@ case "$1" in
>> dogtags
>> ;;
>>
>> - "tags")
>> - rm -f tags
>> - xtags ctags
>> - remove_structs=y
>> - ;;
>> -
>> - "TAGS")
>> - rm -f TAGS
>> - xtags etags
>> + "TAGS" | "tags")
>> + rm -f $1
>> + xtags $([ $1 = "tags" ] \
>> + && echo ctags \
>> + || echo etags)
>> remove_structs=y
>> ;;
>
> Ick, that's much harder to read and understand.
>
> What is wrong with the existing code? It's obvious and makes sense, it
> is not duplicating any lines here except the one "remove_structs=y"
> which is fine.
>
> I'm not going to take this, sorry.
>
> greg k-h
>
Ok you're right, Easy to understand is better.
Thank you.
zackary
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-27 2:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03 15:35 [PATCH] scripts/tags: merge "TAGS" and "tags" in case Zhaoyu Liu
2021-11-26 15:58 ` Greg KH
2021-11-27 1:33 ` Zackary Liu
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 NNTP newsgroup(s).