git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/4] sample hooks: become hash agnostic
@ 2020-09-18 11:19 Denton Liu
  2020-09-18 11:19 ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Denton Liu
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Denton Liu @ 2020-09-18 11:19 UTC (permalink / raw)
  To: Git Mailing List; +Cc: brian m . carlson

There are currently two hooks that have hardcoded 40 zeros as the null
OID and, thus, are not hash-agnostic. Rewrite these to use the newly
introduced `git rev-parse --null-oid` so that they become hash-agnostic.

Denton Liu (4):
  hooks--pre-push.sample: prefer $() for command substitution
  builtin/rev-parse: learn --null-oid
  hooks--pre-push.sample: use hash-agnostic null OID
  hooks--update.sample: use hash-agnostic null OID

 Documentation/git-rev-parse.txt  | 4 ++++
 builtin/rev-parse.c              | 4 ++++
 t/t1500-rev-parse.sh             | 6 ++++++
 templates/hooks--pre-push.sample | 8 ++++----
 templates/hooks--update.sample   | 2 +-
 5 files changed, 19 insertions(+), 5 deletions(-)

-- 
2.28.0.618.gf4bc123cb7


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
@ 2020-09-18 11:19 ` Denton Liu
  2020-09-18 16:57   ` Eric Sunshine
  2020-09-18 11:19 ` [PATCH 2/4] builtin/rev-parse: learn --null-oid Denton Liu
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Denton Liu @ 2020-09-18 11:19 UTC (permalink / raw)
  To: Git Mailing List; +Cc: brian m . carlson

The preferred form for a command substitution is $() over ``. Use this
form for the command substitution in the sample hook.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--pre-push.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index 6187dbf439..64b5707553 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -41,7 +41,7 @@ do
 		fi
 
 		# Check for WIP commit
-		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
+		commit="$(git rev-list -n 1 --grep '^WIP' "$range")"
 		if [ -n "$commit" ]
 		then
 			echo >&2 "Found WIP commit in $local_ref, not pushing"
-- 
2.28.0.618.gf4bc123cb7


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
  2020-09-18 11:19 ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Denton Liu
@ 2020-09-18 11:19 ` Denton Liu
  2020-09-18 14:11   ` Taylor Blau
  2020-09-18 11:19 ` [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID Denton Liu
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Denton Liu @ 2020-09-18 11:19 UTC (permalink / raw)
  To: Git Mailing List; +Cc: brian m . carlson

When a user needed the null OID for scripting purposes, it used to be
very easy: hardcode 40 zeros. However, since Git started supporting
SHA-256, this assumption became false which may break some scripts.
Allow users to fix their broken scripts by providing users with a
hash-agnostic method of obtaining the null OID.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Documentation/git-rev-parse.txt | 4 ++++
 builtin/rev-parse.c             | 4 ++++
 t/t1500-rev-parse.sh            | 6 ++++++
 3 files changed, 14 insertions(+)

diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 19b12b6d43..b370d425d7 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -285,6 +285,10 @@ print a message to stderr and exit with nonzero status.
 Other Options
 ~~~~~~~~~~~~~
 
+--null-oid::
+	Print the null OID (the OID containing all zeros). This OID is
+	used to represent a non-existent object.
+
 --since=datestring::
 --after=datestring::
 	Parse the date string, and output the corresponding
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index ed200c8af1..4e4ca99775 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -910,6 +910,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
 				}
 				continue;
 			}
+			if (!strcmp(arg, "--null-oid")) {
+				puts(oid_to_hex(&null_oid));
+				continue;
+			}
 			if (skip_prefix(arg, "--since=", &arg)) {
 				show_datestring("--max-age=", arg);
 				continue;
diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh
index 408b97d5af..8c1bd543ef 100755
--- a/t/t1500-rev-parse.sh
+++ b/t/t1500-rev-parse.sh
@@ -185,4 +185,10 @@ test_expect_success 'showing the superproject correctly' '
 	test_cmp expect out
 '
 
+test_expect_success 'rev-parse --null-oid' '
+	echo "$(test_oid zero)" >expect &&
+	git rev-parse --null-oid >actual &&
+	test_cmp expect actual
+'
+
 test_done
-- 
2.28.0.618.gf4bc123cb7


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
  2020-09-18 11:19 ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Denton Liu
  2020-09-18 11:19 ` [PATCH 2/4] builtin/rev-parse: learn --null-oid Denton Liu
@ 2020-09-18 11:19 ` Denton Liu
  2020-09-18 17:06   ` Eric Sunshine
  2020-09-18 11:19 ` [PATCH 4/4] hooks--update.sample: " Denton Liu
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Denton Liu @ 2020-09-18 11:19 UTC (permalink / raw)
  To: Git Mailing List; +Cc: brian m . carlson

The pre-push sample hook has the null OID hardcoded as 40 zeros.
However, with the introduction of SHA-256 support, this assumption no
longer holds true. Replace the hardcoded $z40 with a call to
`git rev-parse --null-oid` so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--pre-push.sample | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index 64b5707553..b3bc5276bf 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -22,16 +22,16 @@
 remote="$1"
 url="$2"
 
-z40=0000000000000000000000000000000000000000
+null_oid="$(git rev-parse --null-oid)"
 
 while read local_ref local_sha remote_ref remote_sha
 do
-	if [ "$local_sha" = $z40 ]
+	if [ "$local_sha" = "$null_oid" ]
 	then
 		# Handle delete
 		:
 	else
-		if [ "$remote_sha" = $z40 ]
+		if [ "$remote_sha" = "$null_oid" ]
 		then
 			# New branch, examine all commits
 			range="$local_sha"
-- 
2.28.0.618.gf4bc123cb7


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 4/4] hooks--update.sample: use hash-agnostic null OID
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
                   ` (2 preceding siblings ...)
  2020-09-18 11:19 ` [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID Denton Liu
@ 2020-09-18 11:19 ` Denton Liu
  2020-09-18 17:08   ` Eric Sunshine
  2020-09-18 21:35 ` [PATCH 0/4] sample hooks: become hash agnostic brian m. carlson
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
  5 siblings, 1 reply; 23+ messages in thread
From: Denton Liu @ 2020-09-18 11:19 UTC (permalink / raw)
  To: Git Mailing List; +Cc: brian m . carlson

The update sample hook has the null OID hardcoded as 40 zeros. However,
with the introduction of SHA-256 support, this assumption no longer
holds true. Replace the hardcoded $z40 with a call to
`git rev-parse --null-oid` so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--update.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index 5014c4b31c..5316362af5 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks--update.sample
@@ -60,7 +60,7 @@ esac
 
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a ref.
-zero="0000000000000000000000000000000000000000"
+zero="$(git rev-list --null-oid)"
 if [ "$newrev" = "$zero" ]; then
 	newrev_type=delete
 else
-- 
2.28.0.618.gf4bc123cb7


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 11:19 ` [PATCH 2/4] builtin/rev-parse: learn --null-oid Denton Liu
@ 2020-09-18 14:11   ` Taylor Blau
  2020-09-18 14:16     ` Taylor Blau
  2020-09-18 21:26     ` brian m. carlson
  0 siblings, 2 replies; 23+ messages in thread
From: Taylor Blau @ 2020-09-18 14:11 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, brian m . carlson

Hi Denton,

On Fri, Sep 18, 2020 at 04:19:03AM -0700, Denton Liu wrote:
> When a user needed the null OID for scripting purposes, it used to be
> very easy: hardcode 40 zeros. However, since Git started supporting
> SHA-256, this assumption became false which may break some scripts.
> Allow users to fix their broken scripts by providing users with a
> hash-agnostic method of obtaining the null OID.

I have not been very involved in the hash transition, so please take my
comments with a grain of salt (and if they are misplaced, feel free to
ignore them).

This '--null-oid' thing makes me wonder exactly what it does. Yours
gives a type-less object back, but what about scripts that want the OID
of the empty blob or tree?

Would having something like '--null-oid[=<type>]' be useful for them? On
the one hand, it seems like a thing that would be useful, but on the
other, those aren't *the* null OID when 'type' is 'blob' or 'tree'. A
more appropriate name in that case might be '--empty-oid=tree'.

So, that's an argument that '--null-oid' and '--empty-oid[=<type>]'
should be two distinct things. I think I like that best. Do you have any
thoughts about it?

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 14:11   ` Taylor Blau
@ 2020-09-18 14:16     ` Taylor Blau
  2020-09-18 18:16       ` Junio C Hamano
  2020-09-18 21:26     ` brian m. carlson
  1 sibling, 1 reply; 23+ messages in thread
From: Taylor Blau @ 2020-09-18 14:16 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, brian m . carlson

On Fri, Sep 18, 2020 at 10:11:25AM -0400, Taylor Blau wrote:
> Hi Denton,
>
> On Fri, Sep 18, 2020 at 04:19:03AM -0700, Denton Liu wrote:
> > When a user needed the null OID for scripting purposes, it used to be
> > very easy: hardcode 40 zeros. However, since Git started supporting
> > SHA-256, this assumption became false which may break some scripts.
> > Allow users to fix their broken scripts by providing users with a
> > hash-agnostic method of obtaining the null OID.
>
> I have not been very involved in the hash transition, so please take my
> comments with a grain of salt (and if they are misplaced, feel free to
> ignore them).

Same disclaimer above applies here, too ;-). There are a number of spots
in the test suite that reference 'ZERO_OID', as well as OIDs for the
empty tree and blob. Maybe the definition of those could be updated to
use any new flags you do/don't introduce?

I'd be just as happy if that were to occur in a different series than
this, since I don't want to hold you up by adding a bunch of new things
to your list.

In either case, I think '--zero-oid' makes more sense than '--null-oid'
(and it matches the tests that are already written). The pair
'--zero-oid' and '--empty-oid=<type>' make sense to me.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution
  2020-09-18 11:19 ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Denton Liu
@ 2020-09-18 16:57   ` Eric Sunshine
  0 siblings, 0 replies; 23+ messages in thread
From: Eric Sunshine @ 2020-09-18 16:57 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, brian m . carlson

On Fri, Sep 18, 2020 at 7:19 AM Denton Liu <liu.denton@gmail.com> wrote:
> The preferred form for a command substitution is $() over ``. Use this
> form for the command substitution in the sample hook.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
> @@ -41,7 +41,7 @@ do
> -               commit=`git rev-list -n 1 --grep '^WIP' "$range"`
> +               commit="$(git rev-list -n 1 --grep '^WIP' "$range")"

The double quotes around $(...) are unnecessary and just add noise.

>                 if [ -n "$commit" ]

If you're looking for style fixes, then this would be another
candidate (using 'test' instead of '[').

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID
  2020-09-18 11:19 ` [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID Denton Liu
@ 2020-09-18 17:06   ` Eric Sunshine
  0 siblings, 0 replies; 23+ messages in thread
From: Eric Sunshine @ 2020-09-18 17:06 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, brian m . carlson, Taylor Blau

On Fri, Sep 18, 2020 at 7:19 AM Denton Liu <liu.denton@gmail.com> wrote:
> The pre-push sample hook has the null OID hardcoded as 40 zeros.
> However, with the introduction of SHA-256 support, this assumption no
> longer holds true. Replace the hardcoded $z40 with a call to
> `git rev-parse --null-oid` so the sample hook becomes hash-agnostic.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
> @@ -22,16 +22,16 @@
> +null_oid="$(git rev-parse --null-oid)"
>
>  while read local_ref local_sha remote_ref remote_sha
>  do
> -       if [ "$local_sha" = $z40 ]
> +       if [ "$local_sha" = "$null_oid" ]

Seeing this made me wonder if, rather than introducing a --null-oid
option (or --zero-oid per Taylor's suggestion), it would make more
sense to answer the question more directly. For instance:

    if test rev-parse --is-null-oid "$local_sha"
    then
        ...

Or, if following Taylor's suggestion, you would add --is-zero-oid,
--is-empty-blob, --is-empty-tree.

On the other hand, as this is used in a loop, being able to ask for
the null (or zero) OID just once before the loop does make sense, so
maybe the --is-*-oid forms are less practical.

By the way, if you're cleaning up the sample scripts to make them
hash-agnostic, then it would also make sense to s/sha/oid/.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 4/4] hooks--update.sample: use hash-agnostic null OID
  2020-09-18 11:19 ` [PATCH 4/4] hooks--update.sample: " Denton Liu
@ 2020-09-18 17:08   ` Eric Sunshine
  0 siblings, 0 replies; 23+ messages in thread
From: Eric Sunshine @ 2020-09-18 17:08 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List, brian m . carlson

On Fri, Sep 18, 2020 at 7:19 AM Denton Liu <liu.denton@gmail.com> wrote:
> The update sample hook has the null OID hardcoded as 40 zeros. However,
> with the introduction of SHA-256 support, this assumption no longer
> holds true. Replace the hardcoded $z40 with a call to
> `git rev-parse --null-oid` so the sample hook becomes hash-agnostic.
>
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
> @@ -60,7 +60,7 @@ esac
> -zero="0000000000000000000000000000000000000000"
> +zero="$(git rev-list --null-oid)"

Definitely want a s/rev-list/rev-parse/ here.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 14:16     ` Taylor Blau
@ 2020-09-18 18:16       ` Junio C Hamano
  2020-09-18 18:21         ` Taylor Blau
  0 siblings, 1 reply; 23+ messages in thread
From: Junio C Hamano @ 2020-09-18 18:16 UTC (permalink / raw)
  To: Taylor Blau; +Cc: Denton Liu, Git Mailing List, brian m . carlson

Taylor Blau <me@ttaylorr.com> writes:

> In either case, I think '--zero-oid' makes more sense than '--null-oid'
> (and it matches the tests that are already written). The pair
> '--zero-oid' and '--empty-oid=<type>' make sense to me.

I am not sure rev-parse should even know about "empty-oid".  An end
user or a script who wants to learn what name an empty blob has can
and should ask "git hash-object -t blob --stdin </dev/null".

I can buy --zero-oid might be handy, but don't see a pressing need
if it is merely to support our test suite and sample hooks.
Instead, something like

  ZERO_OID=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')

should suffice, no?

Take this as a mild indifference, not as a strong rejection.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 18:16       ` Junio C Hamano
@ 2020-09-18 18:21         ` Taylor Blau
  0 siblings, 0 replies; 23+ messages in thread
From: Taylor Blau @ 2020-09-18 18:21 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Taylor Blau, Denton Liu, Git Mailing List, brian m . carlson

On Fri, Sep 18, 2020 at 11:16:54AM -0700, Junio C Hamano wrote:
> Taylor Blau <me@ttaylorr.com> writes:
>
> > In either case, I think '--zero-oid' makes more sense than '--null-oid'
> > (and it matches the tests that are already written). The pair
> > '--zero-oid' and '--empty-oid=<type>' make sense to me.
>
> I am not sure rev-parse should even know about "empty-oid".  An end
> user or a script who wants to learn what name an empty blob has can
> and should ask "git hash-object -t blob --stdin </dev/null".

Yeah, my uncertainty ("should this be '--empty-oid' or '--null-oid'?")
is probably a good indication (to me, at least) that the option
shouldn't even exist.

> I can buy --zero-oid might be handy, but don't see a pressing need
> if it is merely to support our test suite and sample hooks.
> Instead, something like
>
>   ZERO_OID=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
>
> should suffice, no?

Absolutely.

> Take this as a mild indifference, not as a strong rejection.

For what it's worth, I'm probably as indifferent as you. I would be
slightly less so if there was evidence of lots of out-of-tree scripts
that care about these special OIDs, but I haven't looked too far.


Thanks,
Taylor

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 14:11   ` Taylor Blau
  2020-09-18 14:16     ` Taylor Blau
@ 2020-09-18 21:26     ` brian m. carlson
  2020-09-20  4:25       ` Chris Torek
                         ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: brian m. carlson @ 2020-09-18 21:26 UTC (permalink / raw)
  To: Taylor Blau; +Cc: Denton Liu, Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]

On 2020-09-18 at 14:11:25, Taylor Blau wrote:
> Hi Denton,
> 
> On Fri, Sep 18, 2020 at 04:19:03AM -0700, Denton Liu wrote:
> > When a user needed the null OID for scripting purposes, it used to be
> > very easy: hardcode 40 zeros. However, since Git started supporting
> > SHA-256, this assumption became false which may break some scripts.
> > Allow users to fix their broken scripts by providing users with a
> > hash-agnostic method of obtaining the null OID.
> 
> I have not been very involved in the hash transition, so please take my
> comments with a grain of salt (and if they are misplaced, feel free to
> ignore them).
> 
> This '--null-oid' thing makes me wonder exactly what it does. Yours
> gives a type-less object back, but what about scripts that want the OID
> of the empty blob or tree?
> 
> Would having something like '--null-oid[=<type>]' be useful for them? On
> the one hand, it seems like a thing that would be useful, but on the
> other, those aren't *the* null OID when 'type' is 'blob' or 'tree'. A
> more appropriate name in that case might be '--empty-oid=tree'.
> 
> So, that's an argument that '--null-oid' and '--empty-oid[=<type>]'
> should be two distinct things. I think I like that best. Do you have any
> thoughts about it?

So I definitely want to distinguish between the null (all-zeros) OID and
the OID of an empty object, and I think using "null" and "empty" are
fine.

What I typically do when I write shell scripts, and which may obviate
the need for this patch is turn this:

  [ "$oid" = 0000000000000000000000000000000000000000 ]

into this:

  echo "$oid" | grep -qsE '^0+$'

This is slightly less efficient, but it's also backwards compatible
with older Git version assuming you have a POSIX grep.

If you still want this option, then that's fine, but please make
--null-oid take the same arguments as --show-object-format (and default
to the same value).  Git will soon learn about writing SHA-1 while
storing in SHA-256, and it makes everyone's life better if we can plan
for the future by making it understand these options now.

I'm not sure we need an empty tree and empty blob object, because it's
pretty easy to write these:

  git hash-object -t tree /dev/null
  git hash-object -t blob /dev/null

That's what I've done in some of the transition code at least.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 0/4] sample hooks: become hash agnostic
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
                   ` (3 preceding siblings ...)
  2020-09-18 11:19 ` [PATCH 4/4] hooks--update.sample: " Denton Liu
@ 2020-09-18 21:35 ` brian m. carlson
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
  5 siblings, 0 replies; 23+ messages in thread
From: brian m. carlson @ 2020-09-18 21:35 UTC (permalink / raw)
  To: Denton Liu; +Cc: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

On 2020-09-18 at 11:19:01, Denton Liu wrote:
> There are currently two hooks that have hardcoded 40 zeros as the null
> OID and, thus, are not hash-agnostic. Rewrite these to use the newly
> introduced `git rev-parse --null-oid` so that they become hash-agnostic.

I've looked over this series and I fully agree that the scripts should
be hash agnostic.  I offered an alternative which you may find simpler
and more appealing (or not), but with the constraint that if we add
--null-oid, it should accept an argument, I have no comments beyond what
other folks have added.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 21:26     ` brian m. carlson
@ 2020-09-20  4:25       ` Chris Torek
  2020-09-20 18:58         ` brian m. carlson
  2020-09-20 15:35       ` Taylor Blau
  2020-09-20 16:03       ` Andreas Schwab
  2 siblings, 1 reply; 23+ messages in thread
From: Chris Torek @ 2020-09-20  4:25 UTC (permalink / raw)
  To: brian m. carlson, Taylor Blau, Denton Liu, Git Mailing List

On Fri, Sep 18, 2020 at 2:34 PM brian m. carlson
<sandals@crustytoothpaste.net> wrote:
> So I definitely want to distinguish between the null (all-zeros) OID and
> the OID of an empty object, and I think using "null" and "empty" are
> fine.

(I like this myself)

> What I typically do when I write shell scripts, and which may obviate
> the need for this patch is turn this:
>
>   [ "$oid" = 0000000000000000000000000000000000000000 ]
>
> into this:
>
>   echo "$oid" | grep -qsE '^0+$'
>
> This is slightly less efficient, but it's also backwards compatible
> with older Git version assuming you have a POSIX grep.

Note that a lot of `grep`s do not have `-q` and/or `-s` so the
portable variant of this is `grep '^0+$' >/dev/null` (you only need
the `2>&1` part if you're concerned about bad input files or
an error on a pipe or something).

> I'm not sure we need an empty tree and empty blob object, because it's
> pretty easy to write these:
>
>   git hash-object -t tree /dev/null
>   git hash-object -t blob /dev/null
>
> That's what I've done in some of the transition code at least.

That's what's recommended in my 2012 stackoverflow Q&A, too.
The use of `/dev/null` directly here is perhaps unsatisfactory on
old Windows systems, though...?

Chris

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 21:26     ` brian m. carlson
  2020-09-20  4:25       ` Chris Torek
@ 2020-09-20 15:35       ` Taylor Blau
  2020-09-20 16:03       ` Andreas Schwab
  2 siblings, 0 replies; 23+ messages in thread
From: Taylor Blau @ 2020-09-20 15:35 UTC (permalink / raw)
  To: brian m. carlson, Taylor Blau, Denton Liu, Git Mailing List

On Fri, Sep 18, 2020 at 09:26:09PM +0000, brian m. carlson wrote:
> What I typically do when I write shell scripts, and which may obviate
> the need for this patch is turn this:
>
>   [ "$oid" = 0000000000000000000000000000000000000000 ]
>
> into this:
>
>   echo "$oid" | grep -qsE '^0+$'
>
> This is slightly less efficient, but it's also backwards compatible
> with older Git version assuming you have a POSIX grep.

Yeah, I mostly just have no idea how common this is in the wild. If many
scripts care about the null OID, then a '--null-oid' makes sense to me.
But if it's only a few, then it does not.

> If you still want this option, then that's fine, but please make
> --null-oid take the same arguments as --show-object-format (and default
> to the same value).  Git will soon learn about writing SHA-1 while
> storing in SHA-256, and it makes everyone's life better if we can plan
> for the future by making it understand these options now.

Agreed.

> I'm not sure we need an empty tree and empty blob object, because it's
> pretty easy to write these:
>
>   git hash-object -t tree /dev/null
>   git hash-object -t blob /dev/null
>
> That's what I've done in some of the transition code at least.

I could go either way. This for some reason seems more common to me, so
I wouldn't mind making it easier for callers, but I don't care so much
because what you already wrote is easy enough as-is.

> --
> brian m. carlson: Houston, Texas, US

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-18 21:26     ` brian m. carlson
  2020-09-20  4:25       ` Chris Torek
  2020-09-20 15:35       ` Taylor Blau
@ 2020-09-20 16:03       ` Andreas Schwab
  2 siblings, 0 replies; 23+ messages in thread
From: Andreas Schwab @ 2020-09-20 16:03 UTC (permalink / raw)
  To: brian m. carlson; +Cc: Taylor Blau, Denton Liu, Git Mailing List

On Sep 18 2020, brian m. carlson wrote:

> What I typically do when I write shell scripts, and which may obviate
> the need for this patch is turn this:
>
>   [ "$oid" = 0000000000000000000000000000000000000000 ]
>
> into this:
>
>   echo "$oid" | grep -qsE '^0+$'
>
> This is slightly less efficient, but it's also backwards compatible
> with older Git version assuming you have a POSIX grep.

You can also use

  case $oid in *[1-9a-f]*) ... ;; *) ... ;; esac

which doesn't need an external process.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
  2020-09-20  4:25       ` Chris Torek
@ 2020-09-20 18:58         ` brian m. carlson
  0 siblings, 0 replies; 23+ messages in thread
From: brian m. carlson @ 2020-09-20 18:58 UTC (permalink / raw)
  To: Chris Torek; +Cc: Taylor Blau, Denton Liu, Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]

On 2020-09-20 at 04:25:33, Chris Torek wrote:
> On Fri, Sep 18, 2020 at 2:34 PM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
> > What I typically do when I write shell scripts, and which may obviate
> > the need for this patch is turn this:
> >
> >   [ "$oid" = 0000000000000000000000000000000000000000 ]
> >
> > into this:
> >
> >   echo "$oid" | grep -qsE '^0+$'
> >
> > This is slightly less efficient, but it's also backwards compatible
> > with older Git version assuming you have a POSIX grep.
> 
> Note that a lot of `grep`s do not have `-q` and/or `-s` so the
> portable variant of this is `grep '^0+$' >/dev/null` (you only need
> the `2>&1` part if you're concerned about bad input files or
> an error on a pipe or something).

If we're looking for best compatibility here, then using egrep and
/dev/null is best, I agree.  I personally use the POSIX version because
it's been that way since at least 2001 and I don't have a problem with
requiring compliance with a 19-year-old standard.  But for Git, we
should definitely do whatever we do in the testsuite if we use this
approach, since presumably that works everywhere.

As Andreas pointed out, there are ways to avoid the external process
that we could stuff in a shell function.  I'm not picky.

> > I'm not sure we need an empty tree and empty blob object, because it's
> > pretty easy to write these:
> >
> >   git hash-object -t tree /dev/null
> >   git hash-object -t blob /dev/null
> >
> > That's what I've done in some of the transition code at least.
> 
> That's what's recommended in my 2012 stackoverflow Q&A, too.
> The use of `/dev/null` directly here is perhaps unsatisfactory on
> old Windows systems, though...?

I believe all modern versions of Git for Windows provide /dev/null via
the shell, since it's required for a lot of things to work, so I'm not
worried about this case.  It is definitely good to think about Windows,
though.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 0/3] sample hooks: become hash agnostic
  2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
                   ` (4 preceding siblings ...)
  2020-09-18 21:35 ` [PATCH 0/4] sample hooks: become hash agnostic brian m. carlson
@ 2020-09-23  9:38 ` Denton Liu
  2020-09-23  9:38   ` [PATCH v2 1/3] hooks--pre-push.sample: modernize script Denton Liu
                     ` (3 more replies)
  5 siblings, 4 replies; 23+ messages in thread
From: Denton Liu @ 2020-09-23  9:38 UTC (permalink / raw)
  To: Git Mailing List
  Cc: brian m . carlson, Eric Sunshine, Taylor Blau, Junio C Hamano,
	Chris Torek, Andreas Schwab

There are currently two hooks that have hardcoded 40 zeros as the null
OID and, thus, are not hash-agnostic. Rewrite these to get the zero OID using

	git hash-object --stdin </dev/null | tr '[0-9a-f]' '0'

so that the zero OID is hash-agnostic.

This was initially done by introducing `git rev-parse --null-oid` to get the
zero OID but that seems like overkill. From a cursory search of Github, the
only instances of the zero OID being used come from clones of the git.git
repository (tests and sample hooks). Since we don't want to introduce an option
that no one will use, don't go this route and just do the easiest thing.

If in the future, someone decides that `git rev-parse --zero-oid` is useful,
they can also adjust these hooks accordingly.

Changes since v1:

* Don't implement `git rev-parse --null-oid`

Denton Liu (3):
  hooks--pre-push.sample: modernize script
  hooks--pre-push.sample: use hash-agnostic zero OID
  hooks--update.sample: use hash-agnostic zero OID

 templates/hooks--pre-push.sample | 18 +++++++++---------
 templates/hooks--update.sample   |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

Range-diff against v1:
1:  ed1ade7328 < -:  ---------- hooks--pre-push.sample: prefer $() for command substitution
2:  004f2e4c92 < -:  ---------- builtin/rev-parse: learn --null-oid
3:  9d6c2951ab < -:  ---------- hooks--pre-push.sample: use hash-agnostic null OID
-:  ---------- > 1:  95dd0b19ba hooks--pre-push.sample: modernize script
-:  ---------- > 2:  afb460d9fd hooks--pre-push.sample: use hash-agnostic zero OID
4:  42d2829889 ! 3:  784135549f hooks--update.sample: use hash-agnostic null OID
    @@ Metadata
     Author: Denton Liu <liu.denton@gmail.com>
     
      ## Commit message ##
    -    hooks--update.sample: use hash-agnostic null OID
    +    hooks--update.sample: use hash-agnostic zero OID
     
    -    The update sample hook has the null OID hardcoded as 40 zeros. However,
    +    The update sample hook has the zero OID hardcoded as 40 zeros. However,
         with the introduction of SHA-256 support, this assumption no longer
         holds true. Replace the hardcoded $z40 with a call to
    -    `git rev-parse --null-oid` so the sample hook becomes hash-agnostic.
    +
    +            git hash-object --stdin </dev/null | tr '[0-9a-f]' '0'
    +
    +    so the sample hook becomes hash-agnostic.
     
      ## templates/hooks--update.sample ##
     @@ templates/hooks--update.sample: esac
    @@ templates/hooks--update.sample: esac
      # --- Check types
      # if $newrev is 0000...0000, it's a commit to delete a ref.
     -zero="0000000000000000000000000000000000000000"
    -+zero="$(git rev-list --null-oid)"
    ++zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
      if [ "$newrev" = "$zero" ]; then
      	newrev_type=delete
      else
-- 
2.28.0.760.g8d73e04208


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 1/3] hooks--pre-push.sample: modernize script
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
@ 2020-09-23  9:38   ` Denton Liu
  2020-09-23  9:38   ` [PATCH v2 2/3] hooks--pre-push.sample: use hash-agnostic zero OID Denton Liu
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Denton Liu @ 2020-09-23  9:38 UTC (permalink / raw)
  To: Git Mailing List
  Cc: brian m . carlson, Eric Sunshine, Taylor Blau, Junio C Hamano,
	Chris Torek, Andreas Schwab

The preferred form for a command substitution is $() over ``. Use this
form for the command substitution in the sample hook.

The preferred form for conditional tests is to use `test` over [].
Replace [] with `test`.

Finally, replace all instances of "sha" with "oid".

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--pre-push.sample | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index 6187dbf439..d0f30190ac 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -14,7 +14,7 @@
 # Information about the commits which are being pushed is supplied as lines to
 # the standard input in the form:
 #
-#   <local ref> <local sha1> <remote ref> <remote sha1>
+#   <local ref> <local oid> <remote ref> <remote oid>
 #
 # This sample shows how to prevent push of commits where the log message starts
 # with "WIP" (work in progress).
@@ -24,25 +24,25 @@ url="$2"
 
 z40=0000000000000000000000000000000000000000
 
-while read local_ref local_sha remote_ref remote_sha
+while read local_ref local_oid remote_ref remote_oid
 do
-	if [ "$local_sha" = $z40 ]
+	if test "$local_oid" = $z40
 	then
 		# Handle delete
 		:
 	else
-		if [ "$remote_sha" = $z40 ]
+		if test "$remote_oid" = $z40
 		then
 			# New branch, examine all commits
-			range="$local_sha"
+			range="$local_oid"
 		else
 			# Update to existing branch, examine new commits
-			range="$remote_sha..$local_sha"
+			range="$remote_oid..$local_oid"
 		fi
 
 		# Check for WIP commit
-		commit=`git rev-list -n 1 --grep '^WIP' "$range"`
-		if [ -n "$commit" ]
+		commit=$(git rev-list -n 1 --grep '^WIP' "$range")
+		if test -n "$commit"
 		then
 			echo >&2 "Found WIP commit in $local_ref, not pushing"
 			exit 1
-- 
2.28.0.760.g8d73e04208


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 2/3] hooks--pre-push.sample: use hash-agnostic zero OID
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
  2020-09-23  9:38   ` [PATCH v2 1/3] hooks--pre-push.sample: modernize script Denton Liu
@ 2020-09-23  9:38   ` Denton Liu
  2020-09-23  9:38   ` [PATCH v2 3/3] hooks--update.sample: " Denton Liu
  2020-09-23 16:34   ` [PATCH v2 0/3] sample hooks: become hash agnostic Junio C Hamano
  3 siblings, 0 replies; 23+ messages in thread
From: Denton Liu @ 2020-09-23  9:38 UTC (permalink / raw)
  To: Git Mailing List
  Cc: brian m . carlson, Eric Sunshine, Taylor Blau, Junio C Hamano,
	Chris Torek, Andreas Schwab

The pre-push sample hook has the zero OID hardcoded as 40 zeros.
However, with the introduction of SHA-256 support, this assumption no
longer holds true. Replace the hardcoded $z40 with a call to

	git hash-object --stdin </dev/null | tr '[0-9a-f]' '0'

so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--pre-push.sample | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample
index d0f30190ac..4ce688d32b 100755
--- a/templates/hooks--pre-push.sample
+++ b/templates/hooks--pre-push.sample
@@ -22,16 +22,16 @@
 remote="$1"
 url="$2"
 
-z40=0000000000000000000000000000000000000000
+zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
 
 while read local_ref local_oid remote_ref remote_oid
 do
-	if test "$local_oid" = $z40
+	if test "$local_oid" = "$zero"
 	then
 		# Handle delete
 		:
 	else
-		if test "$remote_oid" = $z40
+		if test "$remote_oid" = "$zero"
 		then
 			# New branch, examine all commits
 			range="$local_oid"
-- 
2.28.0.760.g8d73e04208


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 3/3] hooks--update.sample: use hash-agnostic zero OID
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
  2020-09-23  9:38   ` [PATCH v2 1/3] hooks--pre-push.sample: modernize script Denton Liu
  2020-09-23  9:38   ` [PATCH v2 2/3] hooks--pre-push.sample: use hash-agnostic zero OID Denton Liu
@ 2020-09-23  9:38   ` Denton Liu
  2020-09-23 16:34   ` [PATCH v2 0/3] sample hooks: become hash agnostic Junio C Hamano
  3 siblings, 0 replies; 23+ messages in thread
From: Denton Liu @ 2020-09-23  9:38 UTC (permalink / raw)
  To: Git Mailing List
  Cc: brian m . carlson, Eric Sunshine, Taylor Blau, Junio C Hamano,
	Chris Torek, Andreas Schwab

The update sample hook has the zero OID hardcoded as 40 zeros. However,
with the introduction of SHA-256 support, this assumption no longer
holds true. Replace the hardcoded $z40 with a call to

	git hash-object --stdin </dev/null | tr '[0-9a-f]' '0'

so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 templates/hooks--update.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index 5014c4b31c..c4d426bc6e 100755
--- a/templates/hooks--update.sample
+++ b/templates/hooks--update.sample
@@ -60,7 +60,7 @@ esac
 
 # --- Check types
 # if $newrev is 0000...0000, it's a commit to delete a ref.
-zero="0000000000000000000000000000000000000000"
+zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
 if [ "$newrev" = "$zero" ]; then
 	newrev_type=delete
 else
-- 
2.28.0.760.g8d73e04208


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 0/3] sample hooks: become hash agnostic
  2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
                     ` (2 preceding siblings ...)
  2020-09-23  9:38   ` [PATCH v2 3/3] hooks--update.sample: " Denton Liu
@ 2020-09-23 16:34   ` Junio C Hamano
  3 siblings, 0 replies; 23+ messages in thread
From: Junio C Hamano @ 2020-09-23 16:34 UTC (permalink / raw)
  To: Denton Liu
  Cc: Git Mailing List, brian m . carlson, Eric Sunshine, Taylor Blau,
	Chris Torek, Andreas Schwab

Denton Liu <liu.denton@gmail.com> writes:

> There are currently two hooks that have hardcoded 40 zeros as the null
> OID and, thus, are not hash-agnostic. Rewrite these to get the zero OID using
>
> 	git hash-object --stdin </dev/null | tr '[0-9a-f]' '0'
>
> so that the zero OID is hash-agnostic.
>
> This was initially done by introducing `git rev-parse --null-oid` to get the
> zero OID but that seems like overkill. From a cursory search of Github, the
> only instances of the zero OID being used come from clones of the git.git
> repository (tests and sample hooks). Since we don't want to introduce an option
> that no one will use, don't go this route and just do the easiest thing.

Patches 2&3/3 look quite sensible.

Patch 1/3 is a borderline Meh, as we do not need to force _our_
coding convention to the end-users, even though we do do so on
ourselves.  But let's take it to make things more consistent.

Thanks.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-09-23 16:34 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 11:19 [PATCH 0/4] sample hooks: become hash agnostic Denton Liu
2020-09-18 11:19 ` [PATCH 1/4] hooks--pre-push.sample: prefer $() for command substitution Denton Liu
2020-09-18 16:57   ` Eric Sunshine
2020-09-18 11:19 ` [PATCH 2/4] builtin/rev-parse: learn --null-oid Denton Liu
2020-09-18 14:11   ` Taylor Blau
2020-09-18 14:16     ` Taylor Blau
2020-09-18 18:16       ` Junio C Hamano
2020-09-18 18:21         ` Taylor Blau
2020-09-18 21:26     ` brian m. carlson
2020-09-20  4:25       ` Chris Torek
2020-09-20 18:58         ` brian m. carlson
2020-09-20 15:35       ` Taylor Blau
2020-09-20 16:03       ` Andreas Schwab
2020-09-18 11:19 ` [PATCH 3/4] hooks--pre-push.sample: use hash-agnostic null OID Denton Liu
2020-09-18 17:06   ` Eric Sunshine
2020-09-18 11:19 ` [PATCH 4/4] hooks--update.sample: " Denton Liu
2020-09-18 17:08   ` Eric Sunshine
2020-09-18 21:35 ` [PATCH 0/4] sample hooks: become hash agnostic brian m. carlson
2020-09-23  9:38 ` [PATCH v2 0/3] " Denton Liu
2020-09-23  9:38   ` [PATCH v2 1/3] hooks--pre-push.sample: modernize script Denton Liu
2020-09-23  9:38   ` [PATCH v2 2/3] hooks--pre-push.sample: use hash-agnostic zero OID Denton Liu
2020-09-23  9:38   ` [PATCH v2 3/3] hooks--update.sample: " Denton Liu
2020-09-23 16:34   ` [PATCH v2 0/3] sample hooks: become hash agnostic Junio C Hamano

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git