threads / patch / 56758

v4archive: describe compression level option

Subject: [PATCH v4] archive: describe compression level option

## tl;dr

6 messages between Oct 22, 2021 and Oct 25, 2021. Diffs are folded; open one to read it.

replies: 5people: 3as markdown or json

Bagas Sanjaya· Oct 22, 2021, 06:45 UTC · lore

Describe the only extra option in `git archive`, that is the compression level option. Previously this option is only described for zip backend; add description also for tar backend.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
---
 Changes since v3 [1]:
     - use smaller size - slower time term
     - use <digit> and <number> for compression level
 [1]: https://lore.kernel.org/git/xmqq8ryqxo72.fsf@gitster.g/T/#t
 Documentation/git-archive.txt | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
Show changes to Documentation/git-archive.txt +12 −5
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 9f8172828d..ecfae7e268 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -93,12 +93,19 @@ BACKEND EXTRA OPTIONS
 
 zip
 ~~~
--0::
-	Store the files instead of deflating them.
--9::
-	Highest and slowest compression level.  You can specify any
-	number from 1 to 9 to adjust compression speed and ratio.
+-<digit>::
+	Regulate compression level using the specified <digit>. Higher
+	values enables smaller size at the expense of slower time.
+	Supported values are from `-0` (store-only) to `-9` (best ratio).
+	Default is `-6` if isn't specified.
 
+tar
+~~~
+-<number>::
+	Specify compression level. The value will be passed to the
+	compression command configured in `tar.<format>.command`. See
+	manual page of the configured command for the list of supported
+	levels and the default level if this option isn't specified.
 
 CONFIGURATION
 -------------

base-commit: f443b226ca681d87a3a31e245a70e6bc2769123c
-- 
An old man doll... just what I always wanted! - Clara
Eric Sunshine· Oct 22, 2021, 06:57 UTC · re: Bagas Sanjaya · lore

Re: [PATCH v4] archive: describe compression level option

On Fri, Oct 22, 2021 at 2:48 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
Show 13 quoted lines
> Describe the only extra option in `git archive`, that is the compression
> level option. Previously this option is only described for zip backend;
> add description also for tar backend.
>
> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
> ---
> diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
> @@ -93,12 +93,19 @@ BACKEND EXTRA OPTIONS
>  zip
>  ~~~
> +-<digit>::
> +       Regulate compression level using the specified <digit>. Higher
> +       values enables smaller size at the expense of slower time.
s/enables/enable/
A couple notes:

"slower time" is an unusual way to convey the concept; perhaps say it takes "more time".

I think it was mentioned earlier in this thread that higher compression level does not necessarily mean better compression, though that is certainly the intent; it only means that the tool will "try harder" to make the result smaller. Perhaps it's worth using more exact phrasing (or perhaps it doesn't matter and that's getting too much into the weeds).

> +       Supported values are from `-0` (store-only) to `-9` (best ratio).
> +       Default is `-6` if isn't specified.

s/if isn't/if it isn't/ ...or... s/if isn't/if not/

Show 7 quoted lines
> +tar
> +~~~
> +-<number>::
> +       Specify compression level. The value will be passed to the
> +       compression command configured in `tar.<format>.command`. See
> +       manual page of the configured command for the list of supported
> +       levels and the default level if this option isn't specified.
Junio C Hamano· Oct 23, 2021, 21:13 UTC · re: Eric Sunshine · lore

Re: [PATCH v4] archive: describe compression level option

Eric Sunshine <sunshine@sunshineco.com> writes:
Show 24 quoted lines
>> +-<digit>::
>> +       Regulate compression level using the specified <digit>. Higher
>> +       values enables smaller size at the expense of slower time.
>
> s/enables/enable/
>
> A couple notes:
>
> "slower time" is an unusual way to convey the concept; perhaps say it
> takes "more time".
>
> I think it was mentioned earlier in this thread that higher
> compression level does not necessarily mean better compression, though
> that is certainly the intent; it only means that the tool will "try
> harder" to make the result smaller. Perhaps it's worth using more
> exact phrasing (or perhaps it doesn't matter and that's getting too
> much into the weeds).
>
>> +       Supported values are from `-0` (store-only) to `-9` (best ratio).
>> +       Default is `-6` if isn't specified.
>
> s/if isn't/if it isn't/
> ...or...
> s/if isn't/if not/
Sounds all sensible.

In summary, perhaps something like this? I still have "-9 (best ratio)" which does not say it is merely the intent and not guarantee, but the resulting text read a bit funny with "best ratio" replaced with "try hardest".

----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
From: Bagas Sanjaya <bagasdotme@gmail.com>
Date: Fri, 22 Oct 2021 13:45:44 +0700
Subject: [PATCH] archive: describe compression level option

Describe the only <extra> option in `git archive`, that is the compression level option. Previously this option is only described for zip backend; add description also for tar backend.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
$ git range-diff --word-diff @{1}...
1:  c27c11dc35 ! 1:  63e8b48637 archive: describe compression level option
    @@ Metadata
     ## Commit message ##
        archive: describe compression level option
    
        Describe the only [-extra-]{+<extra>+} option in `git archive`, that is the compression
        level option. Previously this option is only described for zip backend;
        add description also for tar backend.
    
    @@ Documentation/git-archive.txt: BACKEND EXTRA OPTIONS
    -	Highest and slowest compression level.  You can specify any
    -	number from 1 to 9 to adjust compression speed and ratio.
    +-<digit>::
    +	[-Regulate-]{+Specify+} compression [-level using the specified <digit>. Higher-]
    [-+-]{+level.  Larger+} values [-enables smaller size at-]{+allows+} the [-expense of slower time.-]{+command+}
    +	{+to spend more time to compress to smaller size.+}  Supported
{+++}	values are from `-0` (store-only) to `-9` (best ratio).
    +	Default is `-6` if [-isn't specified.-]{+not given.+}
     
    +tar
    +~~~
 Documentation/git-archive.txt | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
Show changes to Documentation/git-archive.txt +12 −5
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index 9f8172828d..fea2e84fdf 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -93,12 +93,19 @@ BACKEND EXTRA OPTIONS
 
 zip
 ~~~
--0::
-	Store the files instead of deflating them.
--9::
-	Highest and slowest compression level.  You can specify any
-	number from 1 to 9 to adjust compression speed and ratio.
+-<digit>::
+	Specify compression level.  Larger values allows the command
+	to spend more time to compress to smaller size.  Supported
+	values are from `-0` (store-only) to `-9` (best ratio).
+	Default is `-6` if not given.
 
+tar
+~~~
+-<number>::
+	Specify compression level. The value will be passed to the
+	compression command configured in `tar.<format>.command`. See
+	manual page of the configured command for the list of supported
+	levels and the default level if this option isn't specified.
 
 CONFIGURATION
 -------------
-- 
2.33.1-943-g0f03e78e89
Eric Sunshine· Oct 25, 2021, 16:39 UTC · re: Junio C Hamano · lore

Re: [PATCH v4] archive: describe compression level option

On Sat, Oct 23, 2021 at 5:13 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
> >> +-<digit>::
> >> +       Regulate compression level using the specified <digit>. Higher
> >> +       values enables smaller size at the expense of slower time.
> >
> > s/enables/enable/
> >
> > A couple notes:
> >
> > "slower time" is an unusual way to convey the concept; perhaps say it
> > takes "more time".
> > [...]
> >> +       Supported values are from `-0` (store-only) to `-9` (best ratio).
> >> +       Default is `-6` if isn't specified.
> >
> > s/if isn't/if it isn't/
> > ...or...
> > s/if isn't/if not/
>
> Sounds all sensible.
>
> In summary, perhaps something like this?  I still have "-9 (best
> ratio)" which does not say it is merely the intent and not
> guarantee, but the resulting text read a bit funny with "best ratio"
> replaced with "try hardest".
This version looks fine. Thanks.
Junio C Hamano· Oct 25, 2021, 17:48 UTC · re: Eric Sunshine · lore

Re: [PATCH v4] archive: describe compression level option

Eric Sunshine <sunshine@sunshineco.com> writes:
Show 6 quoted lines
>> In summary, perhaps something like this?  I still have "-9 (best
>> ratio)" which does not say it is merely the intent and not
>> guarantee, but the resulting text read a bit funny with "best ratio"
>> replaced with "try hardest".
>
> This version looks fine. Thanks.

Thanks for proofreading. I have locally fixed a grammo ("Larger values allow the command"), by the way.

Eric Sunshine· Oct 25, 2021, 17:57 UTC · re: Junio C Hamano · lore

Re: [PATCH v4] archive: describe compression level option

On Mon, Oct 25, 2021 at 1:49 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
> >> In summary, perhaps something like this?  I still have "-9 (best
> >> ratio)" which does not say it is merely the intent and not
> >> guarantee, but the resulting text read a bit funny with "best ratio"
> >> replaced with "try hardest".
> >
> > This version looks fine. Thanks.
>
> Thanks for proofreading.  I have locally fixed a grammo ("Larger
> values allow the command"), by the way.
Bleh. My eyes slid right over that grammo. Oh well.
With that grammo fix, it looks even better.

← back to recent threads