Skip to contentSkip to conversation

t/README: remove mention of adding copyright notices

PATCH In review Thomas Gummerer 2 participants 5 messages Nov 26, 2017 – Dec 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 t/README: remove mention of adding copyright notices

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.

---

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(-)
t/README +1 -4
index 4b079e4494..448569b60e 100644
@@ -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)
 
Signature · 1 line
2.15.0.426.gb06021eeb
#1 lore raw

PATCH 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.

---
 t/README | 5 +++++
 1 file changed, 5 insertions(+)
t/README +5 -0
index 448569b60e..e867d1f8bd 100644
@@ -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.
Signature · 1 line
2.15.0.426.gb06021eeb
Reviewed-by on v1 2/2
#2 lore raw

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

Hi,

Quoted 7 lines · Thomas Gummerer

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.

---
 t/README | 5 +++++
 1 file changed, 5 insertions(+)

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

#3 lore raw
In reply to Thomas Gummerer

Hi,

Quoted 3 lines · Thomas Gummerer

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

#4 lore raw
Quoted 10 lines · Jonathan Nieder

Hi,

Quoted 3 lines · Thomas Gummerer

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).

Quoted 2 lines

Thanks,
Jonathan