threads / patch / 47324

patch, 2 partst/README: remove mention of adding copyright notices

Subject: [PATCH v1 1/2] t/README: remove mention of adding copyright notices

## tl;dr

5 messages between Nov 26, 2017 and Dec 8, 2017. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Thomas Gummerer· Nov 26, 2017, 20:20 UTC · lore

We generally no longer include copyright notices in new test scripts. However t/README still mentions it as something to include at the top of every new script.

Remove that mention as it's outdated.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---

I read through some parts of t/README, while working on the tests for the worktree dwim patches, and noticed some things that are outdated/a useful function that's not documented anywhere. Here's a couple of patches to fix that.

 t/README | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Show changes to t/README +1 −4
diff --git a/t/README b/t/README
index 4b079e4494..448569b60e 100644
--- a/t/README
+++ b/t/README
@@ -332,13 +332,10 @@ Writing Tests
 -------------
 
 The test script is written as a shell script.  It should start
-with the standard "#!/bin/sh" with copyright notices, and an
+with the standard "#!/bin/sh", and an
 assignment to variable 'test_description', like this:
 
 	#!/bin/sh
-	#
-	# Copyright (c) 2005 Junio C Hamano
-	#
 
 	test_description='xxx test (option --frotz)
 
-- 
2.15.0.426.gb06021eeb
Thomas Gummerer· Nov 26, 2017, 20:21 UTC · re: Thomas Gummerer · lore

[PATCH v1 2/2] t/README: document test_cmp_rev

test_cmp_rev is a useful function that's used in quite a few test scripts. It is however not documented in t/README. Document it.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
---
 t/README | 5 +++++
 1 file changed, 5 insertions(+)
Show changes to t/README +5 −0
diff --git a/t/README b/t/README
index 448569b60e..e867d1f8bd 100644
--- a/t/README
+++ b/t/README
@@ -674,6 +674,11 @@ library for your script to use.
    <expected> file.  This behaves like "cmp" but produces more
    helpful output when the test is run with "-v" option.
 
+ - test_cmp_rev <expected> <actual>
+
+   Check whether the <expected> rev points to the same commit as the
+   <actual> rev.
+
  - test_line_count (= | -lt | -ge | ...) <length> <file>
 
    Check whether a file has the length it is expected to.
-- 
2.15.0.426.gb06021eeb
Jonathan Nieder· Dec 5, 2017, 19:46 UTC · re: Thomas Gummerer · lore

Re: [PATCH v1 2/2] t/README: document test_cmp_rev

Hi,
Thomas Gummerer wrote:
Show 7 quoted lines
> test_cmp_rev is a useful function that's used in quite a few test
> scripts.  It is however not documented in t/README.  Document it.
>
> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
> ---
>  t/README | 5 +++++
>  1 file changed, 5 insertions(+)
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

I admit I usually go straight to t/test-lib-functions.sh when I want to find an appropriate helper. I think this kind of introductory documentation in t/README is still useful, though.

Thanks, Jonathan

Jonathan Nieder· Dec 5, 2017, 19:49 UTC · re: Thomas Gummerer · lore

Re: [PATCH v1 1/2] t/README: remove mention of adding copyright notices

Hi,
Thomas Gummerer wrote:
> We generally no longer include copyright notices in new test scripts.
> However t/README still mentions it as something to include at the top of
> every new script.

Where can I read more about this change? Was it a deliberate change or something that simply happened?

Thanks, Jonathan

Thomas Gummerer· Dec 8, 2017, 20:47 UTC · re: Jonathan Nieder · lore

Re: [PATCH v1 1/2] t/README: remove mention of adding copyright notices

On 12/05, Jonathan Nieder wrote:
Show 10 quoted lines
> Hi,
> 
> Thomas Gummerer wrote:
> 
> > We generally no longer include copyright notices in new test scripts.
> > However t/README still mentions it as something to include at the top of
> > every new script.
> 
> Where can I read more about this change?  Was it a deliberate change
> or something that simply happened?

I'm not sure if it was a deliberate change, I just noticed that most new test files don't have a copyright notice anymore.

    $ git grep "Copyright (c)" t/* | sed -E 's/.*?Copyright .c. ([[:digit:]]+).*?/\1/' | sort | uniq -c
         61 2005
         40 2006
         55 2007
         32 2008
         31 2009
         30 2010
         10 2011
         14 2012
          4 2013
          3 2014
          1 2015
          5 2016

While we may be adding less new test files, we definitely added a few in 2017, for example t/t7521-ignored-mode.sh in 371c80c746 ("status: test ignored modes", 2017-10-30), or t/t0025-crlf-renormalize.sh in 9472935d81 ("add: introduce "--renormalize"", 2017-11-16).

> Thanks,
> Jonathan

← back to recent threads