Local git repository url

2015-11-19 Thread Vambara, JayaPrakash (Infosys)
Hi Team,

I am trying to setup a local git repository and manage it from local Jenkins 
set-up. So, both Jenkins and git are on my local desktop.

However, I am trying to give the Repository URL but with no luck.

My repository is in D drive in location D:\Git-Try

I tried to configure this Repository URL as --- file:///d/Git-Try  also 
file:///D:\Git-Try , but was not successful.

Can you please let me know what should be the Repository URL.

I have created the db in above location, pushed few files and commited them as 
well.

Thanks and Regards,
V. JayaPrakash
+91 9573457665

This e-mail and any files transmitted with it are 
confidential and may be protected by legal privilege. 
If you are not the intended recipient, please notify 
the sender and delete the e-mail from your system. 
This e-mail has been scanned for malicious content but 
the internet is inherently insecure and EDF Energy plc 
cannot accept any liability for the integrity of this 
message or its attachments. No employee or agent of EDF 
Energy plc or any related company is authorised to 
conclude any binding agreement on behalf of EDF Energy 
plc or any related company by e-mail. 

All e-mails sent and received by EDF Energy plc are 
monitored to ensure compliance with the company's 
information security policy.  Executable and script 
files are not permitted through the EDF Energy plc mail 
gateway.  EDF Energy does not accept or send mails above 
30 Mb in size.

EDF Energy plc
Registered in England and Wales No. 2366852
Registered Office: 40 Grosvenor Place, London SW1X 7EN

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 6/6] Add Travis CI support

2015-11-19 Thread larsxschneider
From: Lars Schneider 

The tests are currently executed on "Ubuntu 12.04 LTS Server Edition
64 bit" and on "OS X Mavericks" using gcc and clang.

Perforce and Git-LFS are installed and therefore available for the
respective tests.

Signed-off-by: Lars Schneider 
---
 .travis.yml | 131 
 1 file changed, 131 insertions(+)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000..61c70fa
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,131 @@
+language: c
+
+os:
+  - linux
+  - osx
+
+compiler:
+  - clang
+  - gcc
+
+addons:
+  apt:
+packages:
+- language-pack-is
+
+env:
+  global:
+- P4_VERSION="15.1"
+- GIT_LFS_VERSION="1.0.2"
+- DEFAULT_TEST_TARGET=prove
+- GIT_PROVE_OPTS="--timer --jobs 3"
+- GIT_TEST_OPTS="--verbose --tee"
+- GETTEXT_ISO_LOCALE=YesPlease
+- GETTEXT_LOCALE=YesPlease
+# - GETTEXT_POISON=YesPlease
+- GIT_TEST_CHAIN_LINT=YesPlease
+- GIT_TEST_CLONE_2GB=YesPlease
+# - GIT_TEST_LONG=YesPlease
+  matrix:
+-
+  # NO_ICONV=YesPlease
+- >
+  NO_CURL=YesPlease
+  NO_D_INO_IN_DIRENT=YesPlease
+  NO_DEFLATE_BOUND=YesPlease
+  NO_EXPAT=YesPlease
+  NO_GECOS_IN_PWENT=YesPlease
+  NO_GETTEXT=YesPlease
+  NO_HMAC_CTX_CLEANUP=YesPlease
+  NO_HSTRERROR=YesPlease
+  NO_INET_NTOP=YesPlease
+  NO_INET_PTON=YesPlease
+  NO_INITGROUPS=YesPlease
+  NO_INTTYPES_H=YesPlease
+  NO_IPV6=YesPlease
+  NO_IPV6=YesPlease
+  NO_LIBGEN_H=YesPlease
+  NO_MEMMEM=YesPlease
+  NO_MKDTEMP=YesPlease
+  NO_MKSTEMPS=YesPlease
+  NO_MMAP=YesPlease
+  NO_NSEC=YesPlease
+  NO_OPENSSL=YesPlease
+  NO_PERL=YesPlease
+  NO_PTHREADS=YesPlease
+  NO_REGEX=YesPlease
+  NO_SETENV=YesPlease
+  NO_SETITIMER=YesPlease
+  NO_SOCKADDR_STORAGE=YesPlease
+  NO_STRCASESTR=YesPlease
+  NO_STRLCPY=YesPlease
+  NO_STRTOUMAX=YesPlease
+  NO_STRUCT_ITIMERVAL=YesPlease
+  NO_SYMLINK_HEAD=YesPlease
+  NO_SYS_POLL_H=YesPlease
+  NO_SYS_SELECT_H=YesPlease
+  NO_UINTMAX_T=YesPlease
+  NO_UNSETENV=YesPlease
+
+before_install:
+  - >
+case "${TRAVIS_OS_NAME:-linux}" in
+linux)
+  mkdir --parents custom/p4
+  pushd custom/p4
+wget --quiet 
http://filehost.perforce.com/perforce/r$P4_VERSION/bin.linux26x86_64/p4d
+wget --quiet 
http://filehost.perforce.com/perforce/r$P4_VERSION/bin.linux26x86_64/p4
+chmod u+x p4d
+chmod u+x p4
+export PATH="$(pwd):$PATH"
+  popd
+  mkdir --parents custom/git-lfs
+  pushd custom/git-lfs
+wget --quiet 
https://github.com/github/git-lfs/releases/download/v$GIT_LFS_VERSION/git-lfs-linux-amd64-$GIT_LFS_VERSION.tar.gz
+tar --extract --gunzip --file 
"git-lfs-linux-amd64-$GIT_LFS_VERSION.tar.gz"
+cp git-lfs-$GIT_LFS_VERSION/git-lfs .
+export PATH="$(pwd):$PATH"
+  popd
+  ;;
+osx)
+  brew_force_set_latest_binary_hash () {
+FORMULA=$1
+SHA=$(brew fetch --force $FORMULA 2>&1 | grep ^SHA256: | cut -d ' ' -f 
2)
+sed -E -i.bak "s/sha256 \"[0-9a-f]{64}\"/sha256 \"$SHA\"/g" \
+  /usr/local/Library/Taps/homebrew/homebrew-binary/$FORMULA.rb
+  }
+  brew update --quiet
+  brew tap homebrew/binary --quiet
+  brew_force_set_latest_binary_hash perforce
+  brew_force_set_latest_binary_hash perforce-server
+  brew install git-lfs perforce-server perforce
+  ;;
+esac;
+echo "$(tput setaf 6)Perfoce Server Version$(tput sgr0)";
+p4d -V | grep Rev.;
+echo "$(tput setaf 6)Perfoce Client Version$(tput sgr0)";
+p4 -V | grep Rev.;
+echo "$(tput setaf 6)Git-LFS Version$(tput sgr0)";
+git-lfs version;
+
+before_script: make configure && ./configure && make --jobs=2
+
+script: make --quiet test
+
+after_failure:
+  - >
+: '<-- Click here to see detailed test output! 
   ';
+for TEST_EXIT in t/test-results/*.exit;
+do
+  if [ "$(cat "$TEST_EXIT")" != "0" ];
+  then
+TEST_OUT="${TEST_EXIT%exit}out";
+echo 
"";
+echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)";
+echo 
"";
+cat "${TEST_OUT}";
+  fi;
+done;
+
+notifications:
+  email: false
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 4/6] git-p4: add p4d timeout in tests

2015-11-19 Thread larsxschneider
From: Lars Schneider 

In rare cases p4d seems to hang. This watchdog will kill the p4d
process after 300s in any case. That means each individual git p4 test
needs to finish before 300s or it will fail.

Signed-off-by: Lars Schneider 
Acked-by: Luke Diamand 
---
 t/lib-git-p4.sh | 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index 3c9ad9a..acd5578 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -10,6 +10,10 @@ TEST_NO_CREATE_REPO=NoThanks
 # here the maximal retry timeout in seconds.
 RETRY_TIMEOUT=60
 
+# Sometimes p4d seems to hang. Terminate the p4d process automatically after
+# the defined timeout in seconds.
+P4D_TIMEOUT=300
+
 . ./test-lib.sh
 
 if ! test_have_prereq PYTHON
@@ -94,6 +98,19 @@ start_p4d() {
# will be caught with the "kill -0" check below.
i=${P4D_START_PATIENCE:-300}
pid=$(cat "$pidfile")
+
+   timeout=$(($(time_in_seconds) + $P4D_TIMEOUT))
+   while true
+   do
+   if test $(time_in_seconds) -gt $timeout
+   then
+   kill -9 $pid
+   exit 1
+   fi
+   sleep 1
+   done &
+   watchdog_pid=$!
+
ready=
while test $i -gt 0
do
@@ -156,7 +173,8 @@ kill_p4d() {
retry_until_fail kill -9 $pid
# complain if it would not die
test_must_fail kill $pid >/dev/null 2>&1 &&
-   rm -rf "$db" "$cli" "$pidfile"
+   rm -rf "$db" "$cli" "$pidfile" &&
+   retry_until_fail kill -9 $watchdog_pid
 }
 
 cleanup_git() {
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 5/6] git-p4: add trap to kill p4d on test exit

2015-11-19 Thread larsxschneider
From: Lars Schneider 

Sometimes the "prove" test runner hangs on test exit because p4d is
still running. Add a trap to always kill "p4d" on test exit.

You can reproduce the problem by commenting "P4D_TIMEOUT" in
"lib-git-p4.sh" and running "prove ./t9800-git-p4-basic.sh".

Signed-off-by: Lars Schneider 
---
 t/lib-git-p4.sh | 9 +
 1 file changed, 9 insertions(+)

diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index acd5578..f9ae1d7 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -74,6 +74,15 @@ cli="$TRASH_DIRECTORY/cli"
 git="$TRASH_DIRECTORY/git"
 pidfile="$TRASH_DIRECTORY/p4d.pid"

+# Sometimes "prove" seems to hang on exit because p4d is still running
+cleanup() {
+   if test -f "$pidfile"
+   then
+   kill -9 $(cat "$pidfile") 2>/dev/null && exit 255
+   fi
+}
+trap cleanup EXIT
+
 # git p4 submit generates a temp file, which will
 # not get cleaned up if the submission fails.  Don't
 # clutter up /tmp on the test machine.
--
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 2/6] add "ok=sigpipe" to test_must_fail and use it to fix flaky tests

2015-11-19 Thread larsxschneider
From: Lars Schneider 

t5516 "75 - deny fetch unreachable SHA1, allowtipsha1inwant=true" is
flaky in the following case:
1. remote upload-pack finds out "not our ref"
2. remote sends a response and closes the pipe
3. fetch-pack still tries to write commands to the remote upload-pack
4. write call in wrapper.c dies with SIGPIPE

t5504 "9 - push with transfer.fsckobjects" is flaky, too, and returns
SIGPIPE once in a while. I had to remove the final "To dst..." output
check because there is no output if the process dies with SIGPUPE.

Accept such a death-with-sigpipe also as OK when we are expecting a
failure.

Signed-off-by: Lars Schneider 
---
 t/t5504-fetch-receive-strict.sh | 3 +--
 t/t5516-fetch-push.sh   | 6 +++---
 t/test-lib-functions.sh | 4 
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 44f3d5f..a9e382c 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -111,8 +111,7 @@ test_expect_success 'push with transfer.fsckobjects' '
cd dst &&
git config transfer.fsckobjects true
) &&
-   test_must_fail git push --porcelain dst master:refs/heads/test >act &&
-   test_cmp exp act
+   test_must_fail ok=sigpipe git push --porcelain dst 
master:refs/heads/test >act
 '
 
 cat >bogus-commit <<\EOF
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index ec22c98..0a87e19 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1162,15 +1162,15 @@ do
mk_empty shallow &&
(
cd shallow &&
-   test_must_fail git fetch ../testrepo/.git $SHA1_3 &&
-   test_must_fail git fetch ../testrepo/.git $SHA1_1 &&
+   test_must_fail ok=sigpipe git fetch ../testrepo/.git 
$SHA1_3 &&
+   test_must_fail ok=sigpipe git fetch ../testrepo/.git 
$SHA1_1 &&
git --git-dir=../testrepo/.git config 
uploadpack.allowreachablesha1inwant true &&
git fetch ../testrepo/.git $SHA1_1 &&
git cat-file commit $SHA1_1 &&
test_must_fail git cat-file commit $SHA1_2 &&
git fetch ../testrepo/.git $SHA1_2 &&
git cat-file commit $SHA1_2 &&
-   test_must_fail git fetch ../testrepo/.git $SHA1_3
+   test_must_fail ok=sigpipe git fetch ../testrepo/.git 
$SHA1_3
)
'
 done
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 1e762da..1fdc58c 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -598,6 +598,10 @@ test_must_fail () {
then
echo >&2 "test_must_fail: command succeeded: $*"
return 0
+   elif ! case ",$_test_ok," in *,sigpipe,*) false;; esac &&
+   test $exit_code = 141
+   then
+   return 0
elif test $exit_code -gt 129 && test $exit_code -le 192
then
echo >&2 "test_must_fail: died by signal: $*"
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 0/6] Add Travis CI support

2015-11-19 Thread larsxschneider
From: Lars Schneider 

diff to v5:
* check if PID file still exists on P4D cleanup (thanks Luke)
* fix space/tab formatting error
* add sleep to timeout loops (thanks Luke)
* replace 'date +%s' with platform independent Python function (thanks Eric and 
Luke)

With the patches of this series the Travis CI test stability increases.
However, as I am "stress testing" the Travis CI infrastructure you can
see that it is not perfect: https://travis-ci.org/larsxschneider/git/builds

Nevertheless, I believe that Travis CI integration has still value as
contributors can test their patches easily on Linux and OS X before
posting them.

@junio / @peff: Do you consider merging this?

Thanks,
Lars

Lars Schneider (6):
  implement test_might_fail using a refactored test_must_fail
  add "ok=sigpipe" to test_must_fail and use it to fix flaky tests
  git-p4: retry kill/cleanup operations in tests with timeout
  git-p4: add p4d timeout in tests
  git-p4: add trap to kill p4d on test exit
  Add Travis CI support

 .travis.yml | 131 
 t/lib-git-p4.sh |  71 +++---
 t/t5504-fetch-receive-strict.sh |   3 +-
 t/t5516-fetch-push.sh   |   6 +-
 t/test-lib-functions.sh |  39 +++-
 5 files changed, 221 insertions(+), 29 deletions(-)
 create mode 100644 .travis.yml

--
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 1/6] implement test_might_fail using a refactored test_must_fail

2015-11-19 Thread larsxschneider
From: Lars Schneider 

Add an (optional) first parameter "ok=" to test_must_fail
and return success for "". Add "success" as
"" and use it to implement "test_might_fail". This removes
redundancies in test-lib-function.sh.

Signed-off-by: Junio C Hamano 
Signed-off-by: Lars Schneider 
---
 t/test-lib-functions.sh | 35 ---
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 73e37a1..1e762da 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -582,18 +582,32 @@ test_line_count () {
 # the failure could be due to a segv.  We want a controlled failure.
 
 test_must_fail () {
+   case "$1" in
+   ok=*)
+   _test_ok=${1#ok=}
+   shift
+   ;;
+   *)
+   _test_ok=
+   ;;
+   esac
"$@"
exit_code=$?
-   if test $exit_code = 0; then
+   if ! case ",$_test_ok," in *,success,*) false;; esac &&
+   test $exit_code = 0
+   then
echo >&2 "test_must_fail: command succeeded: $*"
-   return 1
-   elif test $exit_code -gt 129 && test $exit_code -le 192; then
+   return 0
+   elif test $exit_code -gt 129 && test $exit_code -le 192
+   then
echo >&2 "test_must_fail: died by signal: $*"
return 1
-   elif test $exit_code = 127; then
+   elif test $exit_code = 127
+   then
echo >&2 "test_must_fail: command not found: $*"
return 1
-   elif test $exit_code = 126; then
+   elif test $exit_code = 126
+   then
echo >&2 "test_must_fail: valgrind error: $*"
return 1
fi
@@ -612,16 +626,7 @@ test_must_fail () {
 # because we want to notice if it fails due to segv.
 
 test_might_fail () {
-   "$@"
-   exit_code=$?
-   if test $exit_code -gt 129 && test $exit_code -le 192; then
-   echo >&2 "test_might_fail: died by signal: $*"
-   return 1
-   elif test $exit_code = 127; then
-   echo >&2 "test_might_fail: command not found: $*"
-   return 1
-   fi
-   return 0
+   test_must_fail ok=success "$@"
 }
 
 # Similar to test_must_fail and test_might_fail, but check that a
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 3/6] git-p4: retry kill/cleanup operations in tests with timeout

2015-11-19 Thread larsxschneider
From: Lars Schneider 

In rare cases kill/cleanup operations in tests fail. Retry these
operations with a timeout to make the test less flaky.

Signed-off-by: Lars Schneider 
---
 t/lib-git-p4.sh | 42 ++
 1 file changed, 34 insertions(+), 8 deletions(-)

diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh
index 7548225..3c9ad9a 100644
--- a/t/lib-git-p4.sh
+++ b/t/lib-git-p4.sh
@@ -6,6 +6,10 @@
 # a subdirectory called "$git"
 TEST_NO_CREATE_REPO=NoThanks
 
+# Some operations require multiple attempts to be successful. Define
+# here the maximal retry timeout in seconds.
+RETRY_TIMEOUT=60
+
 . ./test-lib.sh
 
 if ! test_have_prereq PYTHON
@@ -36,6 +40,15 @@ native_path() {
echo "$path"
 }
 
+# On Solaris the 'date +%s' function is not supported and therefore we
+# need this replacement.
+# Attention: This function is not safe again against time offset updates
+# at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)'
+# function could fix that but it is not in Python until 3.3.
+time_in_seconds() {
+   python -c 'import time; print int(time.time())'
+}
+
 # Try to pick a unique port: guess a large number, then hope
 # no more than one of each test is running.
 #
@@ -121,22 +134,35 @@ p4_add_user() {
EOF
 }
 
+retry_until_success() {
+   timeout=$(($(time_in_seconds) + $RETRY_TIMEOUT))
+   until "$@" 2>/dev/null || test $(time_in_seconds) -gt $timeout
+   do
+   sleep 1
+   done
+}
+
+retry_until_fail() {
+   timeout=$(($(time_in_seconds) + $RETRY_TIMEOUT))
+   until ! "$@" 2>/dev/null || test $(time_in_seconds) -gt $timeout
+   do
+   sleep 1
+   done
+}
+
 kill_p4d() {
pid=$(cat "$pidfile")
-   # it had better exist for the first kill
-   kill $pid &&
-   for i in 1 2 3 4 5 ; do
-   kill $pid >/dev/null 2>&1 || break
-   sleep 1
-   done &&
+   retry_until_fail kill $pid
+   retry_until_fail kill -9 $pid
# complain if it would not die
test_must_fail kill $pid >/dev/null 2>&1 &&
rm -rf "$db" "$cli" "$pidfile"
 }
 
 cleanup_git() {
-   rm -rf "$git" &&
-   mkdir "$git"
+   retry_until_success rm -r "$git"
+   test_must_fail test -d "$git" &&
+   retry_until_success mkdir "$git"
 }
 
 marshal_dump() {
-- 
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/7] modernize t9300: use test_must_be_empty

2015-11-19 Thread Johannes Sixt
Instead of comparing actual output to an empty file, use
test_must_be_empty. In addition to the better error message provided by
the helper, allocation of an empty file during the setup sequence can be
avoided.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index e9c7602..ceb3db3 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -47,8 +47,6 @@ file5_data='an inline file.
 file6_data='#!/bin/sh
 echo "$@"'
 
->empty
-
 ###
 ### series A
 ###
@@ -2320,12 +2318,12 @@ test_expect_success !MINGW 'R: in-stream cat-blob-fd 
not respected' '
cat-blob $blob
EOF
test_cmp expect actual.3 &&
-   test_cmp empty actual.1 &&
+   test_must_be_empty actual.1 &&
git fast-import 3>actual.3 >actual.1 <<-EOF &&
option cat-blob-fd=3
cat-blob $blob
EOF
-   test_cmp empty actual.3 &&
+   test_must_be_empty actual.3 &&
test_cmp expect actual.1
 '
 
@@ -2549,7 +2547,7 @@ EOF
 
 test_expect_success 'R: quiet option results in no stats being output' '
cat input | git fast-import 2> output &&
-   test_cmp empty output
+   test_must_be_empty output
 '
 
 test_expect_success 'R: feature done means terminating "done" is mandatory' '
-- 
2.6.2.337.ga235d84

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/7] Modernize t9300-fast-import

2015-11-19 Thread Johannes Sixt
Some time ago, I had to dig into t9300-fast-import and found it quite
unhelpful that it does not follow our modern best-practices. This series
brings it up-to-date. I thought I submit it now while it is quiet in
the area.

The larger patches are best viewed using -w -color-words because the
regular patch text is ... overwhelming.

Improving shell coding style is outside the scope of this series. I mean
fixing eyesores such as 'cat >foo < bar', or minor
things such as quoting <<\EOF when the here-doc does not require
substitutions.

In case the large patches don't make it to the list, the series is also
available from

  https://github.com/j6t/git.git modernize-t9300

Johannes Sixt (7):
  modernize t9300: single-quote placement and indentation
  modernize t9300: use test_must_fail
  modernize t9300: use test_must_be_empty
  modernize t9300: wrap lines after &&
  modernize t9300: use test_when_finished for clean-up
  modernize t9300: mark here-doc words to ignore tab indentation
  modernize t9300: move test preparations into test_expect_success

 t/t9300-fast-import.sh | 3629 
 1 file changed, 1822 insertions(+), 1807 deletions(-)

-- 
2.6.2.337.ga235d84

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/7] modernize t9300: single-quote placement and indentation

2015-11-19 Thread Johannes Sixt
Many test cases do not follow our modern style that places the
single-quotes that surround the shell code snippets before and after
the shell code. Make it so.

Many of the lines changed in this way are indented other than by a
single tab. Change them (and some additional lines) to be indented
with a tab.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 872 +
 1 file changed, 437 insertions(+), 435 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 9984c48..566f7bd 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -100,10 +100,10 @@ An annotated tag that annotates a blob.
 EOF
 
 INPUT_END
-test_expect_success \
-'A: create pack from stdin' \
-'git fast-import --export-marks=marks.out  
$GIT_COMMITTER_DATE
 
 initial
 EOF
-test_expect_success \
-   'A: verify commit' \
-   'git cat-file commit master | sed 1d >actual &&
-   test_cmp expect actual'
+test_expect_success 'A: verify commit' '
+   git cat-file commit master | sed 1d >actual &&
+   test_cmp expect actual
+'
 
 cat >expect actual &&
+   test_cmp expect actual
+'
 
 echo "$file2_data" >expect
-test_expect_success \
-   'A: verify file2' \
-   'git cat-file blob master:file2 >actual && test_cmp expect actual'
+test_expect_success 'A: verify file2' '
+   git cat-file blob master:file2 >actual && test_cmp expect actual
+'
 
 echo "$file3_data" >expect
-test_expect_success \
-   'A: verify file3' \
-   'git cat-file blob master:file3 >actual && test_cmp expect actual'
+test_expect_success 'A: verify file3' '
+   git cat-file blob master:file3 >actual && test_cmp expect actual
+'
 
 printf "$file4_data" >expect
-test_expect_success \
-   'A: verify file4' \
-   'git cat-file blob master:file4 >actual && test_cmp expect actual'
+test_expect_success 'A: verify file4' '
+   git cat-file blob master:file4 >actual && test_cmp expect actual
+'
 
 cat >expect >actual &&
-   test_cmp expect actual'
+   test_cmp expect actual
+'
 
 test_tick
 cat >input tree.out &&
test_cmp tree.exp_s tree.out &&
-   test_cmp marks.exp marks.large'
+   test_cmp marks.exp marks.large
+'
 
 ###
 ### series B
@@ -342,7 +343,7 @@ M 755 0001 zero1
 
 INPUT_END
 test_expect_success 'B: fail on invalid blob sha1' '
-test_must_fail git fast-import /dev/null >/dev/null
@@ -482,19 +483,19 @@ M 755 $newf file2/newf
 D file3
 
 INPUT_END
-test_expect_success \
-'C: incremental import create pack from stdin' \
-'git fast-import expect < 
$GIT_COMMITTER_DATE
 
 second
 EOF
-test_expect_success \
-   'C: verify commit' \
-   'git cat-file commit branch | sed 1d >actual &&
-test_cmp expect actual'
+test_expect_success 'C: verify commit' '
+   git cat-file commit branch | sed 1d >actual &&
+   test_cmp expect actual
+'
 
 cat >expect expect
-test_expect_success \
-   'D: verify file5' \
-   'git cat-file blob branch:newdir/interesting >actual &&
-test_cmp expect actual'
+test_expect_success 'D: verify file5' '
+   git cat-file blob branch:newdir/interesting >actual &&
+   test_cmp expect actual
+'
 
 echo "$file6_data" >expect
-test_expect_success \
-   'D: verify file6' \
-   'git cat-file blob branch:newdir/exec.sh >actual &&
-test_cmp expect actual'

[PATCH 2/7] modernize t9300: use test_must_fail

2015-11-19 Thread Johannes Sixt
One test case open-codes a test for an expected failure. Replace it by
test_must_fail.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 566f7bd..e9c7602 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -630,20 +630,9 @@ from refs/heads/branch
 
 INPUT_END
 test_expect_success 'F: non-fast-forward update skips' '
-   if git fast-import http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] t1450: add tests for NUL in headers of commits and tags

2015-11-19 Thread Eric Sunshine
On Thu, Nov 19, 2015 at 11:20 AM, René Scharfe  wrote:
> Signed-off-by: Rene Scharfe 
> ---
> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
> @@ -176,6 +176,18 @@ test_expect_success 'integer overflow in timestamps is 
> reported' '
> +test_expect_success 'commit with NUL in header' '
> +   git cat-file commit HEAD >basis &&
> +   sed "s/author ./author Q/" commit-NUL-header &&
> +   new=$(git hash-object -t commit -w --stdin  +   test_when_finished "remove_object $new" &&
> +   git update-ref refs/heads/bogus "$new" &&
> +   test_when_finished "git update-ref -d refs/heads/bogus" &&
> +   test_must_fail git fsck 2>out &&
> +   cat out &&

What is the purpose of this 'cat'?

> +   grep "error in commit $new.*unterminated header: NUL at offset" out
> +'
> @@ -276,6 +288,26 @@ test_expect_success 'tag with bad tagger' '
> +test_expect_failure 'tag with NUL in header' '
> +   sha=$(git rev-parse HEAD) &&
> +   q_to_nul >tag-NUL-header <<-EOF &&
> +   object $sha
> +   type commit
> +   tag contains-Q-in-header
> +   tagger T A Gger  1234567890 -
> +
> +   This is an invalid tag.
> +   EOF
> +
> +   tag=$(git hash-object --literally -t tag -w --stdin  &&
> +   test_when_finished "remove_object $tag" &&
> +   echo $tag >.git/refs/tags/wrong &&
> +   test_when_finished "git update-ref -d refs/tags/wrong" &&
> +   test_must_fail git fsck --tags 2>out &&
> +   cat out &&

Ditto.

> +   grep "error in tag $tag.*unterminated header: NUL at offset" out
> +'
> +
> --
> 2.6.3
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] t1450: add tests for NUL in headers of commits and tags

2015-11-19 Thread René Scharfe

Am 19.11.2015 um 21:33 schrieb Eric Sunshine:

On Thu, Nov 19, 2015 at 11:20 AM, René Scharfe  wrote:

Signed-off-by: Rene Scharfe 
---
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
@@ -176,6 +176,18 @@ test_expect_success 'integer overflow in timestamps is 
reported' '
+test_expect_success 'commit with NUL in header' '
+   git cat-file commit HEAD >basis &&
+   sed "s/author ./author Q/" commit-NUL-header &&
+   new=$(git hash-object -t commit -w --stdin out &&
+   cat out &&


What is the purpose of this 'cat'?


It shows the full error message when the test is run with --debug, which 
is convenient when the following grep doesn't match.  The same is done 
in most tests in that file.





+   grep "error in commit $new.*unterminated header: NUL at offset" out
+'
@@ -276,6 +288,26 @@ test_expect_success 'tag with bad tagger' '
+test_expect_failure 'tag with NUL in header' '
+   sha=$(git rev-parse HEAD) &&
+   q_to_nul >tag-NUL-header <<-EOF &&
+   object $sha
+   type commit
+   tag contains-Q-in-header
+   tagger T A Gger  1234567890 -
+
+   This is an invalid tag.
+   EOF
+
+   tag=$(git hash-object --literally -t tag -w --stdin .git/refs/tags/wrong &&
+   test_when_finished "git update-ref -d refs/tags/wrong" &&
+   test_must_fail git fsck --tags 2>out &&
+   cat out &&


Ditto.


+   grep "error in tag $tag.*unterminated header: NUL at offset" out
+'
+
--
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/7] modernize t9300: mark here-doc words to ignore tab indentation

2015-11-19 Thread Johannes Sixt
In the next commit, we will indent test case preparations. This will
require that here-documents ignore the tab indentation. Prepare for
this change by marking the here-doc words accordingly. This does not
have an effect now, but will remove some noise from the git diff -b
output of the next commit.

The change here is entirely automated with this perl command:

  perl -i -lpe 's/(cat.*<<) *((EOF|(EXPECT|INPUT)_END).*$)/$1-$2 &&/' 
t/t9300-fast-import.sh

i.e., inserts a dash between << and the EOF word (and removes blanks
that our style guide abhors) and appends the && that will become
necessary.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 200 -
 1 file changed, 100 insertions(+), 100 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index adabd68..7586f41 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -57,7 +57,7 @@ test_expect_success 'empty stream succeeds' '
git fast-import input  $GIT_COMMITTER_DATE
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
@@ -118,7 +118,7 @@ test_expect_success 'A: verify commit' '
test_cmp expect actual
 '
 
-cat >expect expect expect expect input input  $GIT_COMMITTER_DATE
 data actual
@@ -274,7 +274,7 @@ mt=$(git hash-object --stdin < /dev/null)
 : >marks.exp
 : >tree.exp
 
-cat >input.commit  $GIT_COMMITTER_DATE
 data <>input.blob <>input.blob <<-EOF &&
 blob
 mark :$l
 data 0
@@ -331,7 +331,7 @@ test_expect_success 'A: export marks with large values' '
 ###
 
 test_tick
-cat >input  $GIT_COMMITTER_DATE
@@ -348,7 +348,7 @@ test_expect_success 'B: fail on invalid blob sha1' '
test_must_fail git fast-import input  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 data  $GIT_COMMITTER_DATE
 committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -507,7 +507,7 @@ test_expect_success 'C: verify commit' '
test_cmp expect actual
 '
 
-cat >expect 

[PATCH 5/7] modernize t9300: use test_when_finished for clean-up

2015-11-19 Thread Johannes Sixt
A number of clean-ups of test cases are performed outside of
test_expect_success. Replace these cases by using test_when_finished.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 36 
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index c36afdb..adabd68 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -344,9 +344,9 @@ M 755 0001 zero1
 
 INPUT_END
 test_expect_success 'B: fail on invalid blob sha1' '
+   test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
test_must_fail git fast-import input /dev/null
-git prune 2>/dev/null >/dev/null
 
 cat >input /dev/null
-git prune 2>/dev/null >/dev/null
 
 cat >input /dev/null
-git prune 2>/dev/null >/dev/null
 
 cat >input actual &&
@@ -921,8 +919,6 @@ test_expect_success 'L: nested tree copy does not corrupt 
deltas' '
git fsck `git rev-parse L2`
 '
 
-git update-ref -d refs/heads/L2
-
 ###
 ### series M
 ###
-- 
2.6.2.337.ga235d84

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] modernize t9300: wrap lines after &

2015-11-19 Thread Johannes Sixt
It is customary to have each command in test snippets on its own line.
Fix those instances that do not follow this guideline.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 48 
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index ceb3db3..c36afdb 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -130,17 +130,20 @@ test_expect_success 'A: verify tree' '
 
 echo "$file2_data" >expect
 test_expect_success 'A: verify file2' '
-   git cat-file blob master:file2 >actual && test_cmp expect actual
+   git cat-file blob master:file2 >actual &&
+   test_cmp expect actual
 '
 
 echo "$file3_data" >expect
 test_expect_success 'A: verify file3' '
-   git cat-file blob master:file3 >actual && test_cmp expect actual
+   git cat-file blob master:file3 >actual &&
+   test_cmp expect actual
 '
 
 printf "$file4_data" >expect
 test_expect_success 'A: verify file4' '
-   git cat-file blob master:file4 >actual && test_cmp expect actual
+   git cat-file blob master:file4 >actual &&
+   test_cmp expect actual
 '
 
 cat >expect actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar~2:$commit1 >actual &&
+   test_cmp expect actual
 '
 
 echo "$note2_data" >expect
 test_expect_success 'Q: verify first note for second commit' '
-   git cat-file blob refs/notes/foobar~2:$commit2 >actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar~2:$commit2 >actual &&
+   test_cmp expect actual
 '
 
 echo "$note3_data" >expect
 test_expect_success 'Q: verify first note for third commit' '
-   git cat-file blob refs/notes/foobar~2:$commit3 >actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar~2:$commit3 >actual &&
+   test_cmp expect actual
 '
 
 cat >expect actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar^:$commit1 >actual &&
+   test_cmp expect actual
 '
 
 echo "$note2_data" >expect
 test_expect_success 'Q: verify first note for second commit' '
-   git cat-file blob refs/notes/foobar^:$commit2 >actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar^:$commit2 >actual &&
+   test_cmp expect actual
 '
 
 echo "$note3_data" >expect
 test_expect_success 'Q: verify first note for third commit' '
-   git cat-file blob refs/notes/foobar^:$commit3 >actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar^:$commit3 >actual &&
+   test_cmp expect actual
 '
 
 cat >expect actual && test_cmp 
expect actual
+   git cat-file blob refs/notes/foobar2:$commit1 >actual &&
+   test_cmp expect actual
 '
 
 cat >expect actual && test_cmp expect 
actual
+   git cat-file blob refs/notes/foobar:$commit2 >actual &&
+   test_cmp expect actual
 '
 
 cat >input 

[PATCH 7/7] modernize t9300: move test preparations into test_expect_success

2015-11-19 Thread Johannes Sixt
Our usual style these days is to execute everything inside
test_expect_success. Make it so.

Signed-off-by: Johannes Sixt 
---
 t/t9300-fast-import.sh | 2580 
 1 file changed, 1297 insertions(+), 1283 deletions(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 7586f41..14a9384 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -51,54 +51,53 @@ echo "$@"'
 ### series A
 ###
 
-test_tick
-
 test_expect_success 'empty stream succeeds' '
git fast-import input <<-INPUT_END &&
-blob
-mark :2
-data < $GIT_COMMITTER_DATE
-data  $GIT_COMMITTER_DATE
-committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
-
-initial
-EOF
 test_expect_success 'A: verify commit' '
+   cat >expect <<-EOF &&
+   author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+   committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+
+   initial
+   EOF
git cat-file commit master | sed 1d >actual &&
test_cmp expect actual
 '
 
-cat >expect <<-EOF &&
-100644 blob file2
-100644 blob file3
-100755 blob file4
-EOF
 test_expect_success 'A: verify tree' '
+   cat >expect <<-EOF &&
+   100644 blob file2
+   100644 blob file3
+   100755 blob file4
+   EOF
git cat-file -p master^{tree} | sed "s/ [0-9a-f]*   / /" >actual &&
test_cmp expect actual
 '
 
-echo "$file2_data" >expect
 test_expect_success 'A: verify file2' '
+   echo "$file2_data" >expect &&
git cat-file blob master:file2 >actual &&
test_cmp expect actual
 '
 
-echo "$file3_data" >expect
 test_expect_success 'A: verify file3' '
+   echo "$file3_data" >expect &&
git cat-file blob master:file3 >actual &&
test_cmp expect actual
 '
 
-printf "$file4_data" >expect
 test_expect_success 'A: verify file4' '
+   printf "$file4_data" >expect &&
git cat-file blob master:file4 >actual &&
test_cmp expect actual
 '
 
-cat >expect <<-EOF &&
-object $(git rev-parse refs/heads/master)
-type commit
-tag series-A
-
-An annotated tag without a tagger
-EOF
 test_expect_success 'A: verify tag/series-A' '
+   cat >expect <<-EOF &&
+   object $(git rev-parse refs/heads/master)
+   type commit
+   tag series-A
+
+   An annotated tag without a tagger
+   EOF
git cat-file tag tags/series-A >actual &&
test_cmp expect actual
 '
 
-cat >expect <<-EOF &&
-object $(git rev-parse refs/heads/master:file3)
-type blob
-tag series-A-blob
-
-An annotated tag that annotates a blob.
-EOF
 test_expect_success 'A: verify tag/series-A-blob' '
+   cat >expect <<-EOF &&
+   object $(git rev-parse refs/heads/master:file3)
+   type blob
+   tag series-A-blob
+
+   An annotated tag that annotates a blob.
+   EOF
git cat-file tag tags/series-A-blob >actual &&
test_cmp expect actual
 '
 
-cat >expect <<-EOF &&
-:2 `git rev-parse --verify master:file2`
-:3 `git rev-parse --verify master:file3`
-:4 `git rev-parse --verify master:file4`
-:5 `git rev-parse --verify master^0`
-EOF
 test_expect_success 'A: verify marks output' '
+   cat >expect <<-EOF &&
+   :2 `git rev-parse --verify master:file2`
+   :3 `git rev-parse --verify master:file3`
+   :4 `git rev-parse --verify master:file4`
+   :5 `git rev-parse --verify master^0`
+   EOF
test_cmp expect marks.out
 '
 
@@ -188,68 +187,69 @@ test_expect_success 'A: verify marks import' '
test_cmp expect marks.new
 '
 
-test_tick
-new_blob=$(echo testing | git hash-object --stdin)
-cat >input <<-INPUT_END &&
-tag series-A-blob-2
-from $(git rev-parse refs/heads/master:file3)
-data < 0 +
-data 0
-M 644 :6 new_blob
-#pretend we got sha1 from fast-import
-ls "new_blob"
-
-tag series-A-blob-3
-from $new_blob
-data input <<-INPUT_END &&
+   tag series-A-blob-2
+   from $(git rev-parse refs/heads/master:file3)
+   data < 0 +
+   data 0
+   M 644 :6 new_blob
+   #pretend we got sha1 from fast-import
+   ls "new_blob"
+
+   tag series-A-blob-3
+   from $new_blob
+   data 

[PATCH v4 2/2] completion: add support for completing email aliases

2015-11-19 Thread Jacob Keller
From: Jacob Keller 

Using the new --dump-aliases option from git-send-email, add completion
for --to, --cc, --bcc, and --from with the available configured aliases.

Signed-off-by: Jacob Keller 
---

Notes:
- v2
* Use git-send-email for parsing instead of re-implementing it in awk

- v3
* update for change to git-send-email
* add support for "--from"

 contrib/completion/git-completion.bash | 16 
 1 file changed, 16 insertions(+)

diff --git a/contrib/completion/git-completion.bash 
b/contrib/completion/git-completion.bash
index 482ca84b451b..111b05302bc7 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -10,6 +10,7 @@
 #*) local and remote tag names
 #*) .git/remotes file names
 #*) git 'subcommands'
+#*) git email aliases for git-send-email
 #*) tree paths within 'ref:path/to/file' expressions
 #*) file paths within current working directory and index
 #*) common --long-options
@@ -1711,6 +1712,15 @@ __git_send_email_suppresscc_options="author self cc 
bodycc sob cccmd body all"
 
 _git_send_email ()
 {
+   case "$prev" in
+   --to|--cc|--bcc|--from)
+   __gitcomp "
+   $(git --git-dir="$(__gitdir)" send-email --dump-aliases 
2>/dev/null)
+   " "" ""
+   return
+   ;;
+   esac
+
case "$cur" in
--confirm=*)
__gitcomp "
@@ -1735,6 +1745,12 @@ _git_send_email ()
" "" "${cur##--thread=}"
return
;;
+   --to=*|--cc=*|--bcc=*|--from=*)
+   __gitcomp "
+   $(git --git-dir="$(__gitdir)" send-email --dump-aliases 
2>/dev/null)
+   " "" "${cur#--*=}"
+   return
+   ;;
--*)
__gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
--compose --confirm= --dry-run --envelope-sender
-- 
2.6.3.491.g3e3f6ce

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/2] sendemail: teach git-send-email to dump alias names

2015-11-19 Thread Jacob Keller
From: Jacob Keller 

Add an option "--dump-aliases" which changes the default behavior of
git-send-email. This mode will simply read the alias files configured by
sendemail.aliasesfile and sendemail.aliasfiletype and dump a list of all
configured aliases, one per line. The intended use case for this option
is the bash-completion script which will use it to autocomplete aliases
on the options which take addresses.

Add some tests for the new option using various alias file formats.

A possible future extension to the alias dump format could be done by
extending the --dump-aliases to take an optional argument defining the
format to display. This has not been done in this patch as no user of
this information has been identified.

Signed-off-by: Jacob Keller 
---

Notes:
- v2
* Add command --list-aliases to git-send-email

- v3
* Add test
* change option to --dump-aliases
* dump both the alias and its expansion

- v4
* Rework and extend tests
* Only print alias names for now, punt full format for when a use case is
  identified
* Ensure no other options are used with --dump-aliases

 Documentation/git-send-email.txt | 11 ++
 git-send-email.perl  | 15 
 t/t9001-send-email.sh| 82 
 3 files changed, 108 insertions(+)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index b9134d234f53..771a7b5b0915 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -10,6 +10,7 @@ SYNOPSIS
 
 [verse]
 'git send-email' [options] ...
+'git send-email' --dump-aliases
 
 
 DESCRIPTION
@@ -387,6 +388,16 @@ default to '--validate'.
Send emails even if safety checks would prevent it.
 
 
+Information
+~~~
+
+--dump-aliases::
+   Instead of the normal operation, dump the shorthand alias names from
+   the configured alias file(s), one per line in alphabetical order. Note,
+   this only includes the alias name and not its expanded email addresses.
+   See 'sendemail.aliasesfile' for more information about aliases.
+
+
 CONFIGURATION
 -
 
diff --git a/git-send-email.perl b/git-send-email.perl
index e907e0eacf31..a475b0d75370 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -46,6 +46,7 @@ package main;
 sub usage {
print < \$help,
+"dump-aliases" => \$dump_aliases);
+usage() unless $rc;
+die "--dump-aliases incompatible with other options\n"
+if !$help and $dump_aliases and @ARGV;
+$rc = GetOptions(
"sender|from=s" => \$sender,
 "in-reply-to=s" => \$initial_reply_to,
"subject=s" => \$initial_subject,
@@ -551,6 +561,11 @@ if (@alias_files and $aliasfiletype and defined 
$parse_alias{$aliasfiletype}) {
}
 }
 
+if ($dump_aliases) {
+print "$_\n" for (sort keys %aliases);
+exit(0);
+}
+
 # is_format_patch_arg($f) returns 0 if $f names a patch, or 1 if
 # $f is a revision list specification to be passed to format-patch.
 sub is_format_patch_arg {
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 5b4a5ce06b94..3c49536e0e8d 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1555,6 +1555,88 @@ test_expect_success $PREREQ 
'sendemail.aliasfile=~/.mailrc' '
grep "^!someone@example\.org!$" commandline1
 '
 
+test_dump_aliases () {
+   msg="$1" && shift &&
+   filetype="$1" && shift &&
+   printf '%s\n' "$@" >expect &&
+   cat >.tmp-email-aliases &&
+
+   test_expect_success $PREREQ "$msg" '
+   clean_fake_sendmail && rm -fr outdir &&
+   git config --replace-all sendemail.aliasesfile \
+   "$(pwd)/.tmp-email-aliases" &&
+   git config sendemail.aliasfiletype "$filetype" &&
+   git send-email --dump-aliases 2>errors >actual &&
+   test_cmp expect actual
+   '
+}
+
+test_dump_aliases '--dump-aliases sendmail format' \
+   'sendmail' \
+   'abgroup' \
+   'alice' \
+   'bcgrp' \
+   'bob' \
+   'chloe' <<-\EOF
+   alice: Alice W Land 
+  

Re: Local git repository url

2015-11-19 Thread Jacob Keller
On Thu, Nov 19, 2015 at 3:06 AM, Konstantin Khomoutov
 wrote:
> On Thu, 19 Nov 2015 10:48:51 +
> "Vambara, JayaPrakash (Infosys)" 
> wrote:
>
>> I am trying to setup a local git repository and manage it from local
>> Jenkins set-up. So, both Jenkins and git are on my local desktop.
>>
>> However, I am trying to give the Repository URL but with no luck.
>>
>> My repository is in D drive in location D:\Git-Try
>>
>> I tried to configure this Repository URL as --- file:///d/Git-Try
>>  also file:///D:\Git-Try , but was not successful.
>>
>> Can you please let me know what should be the Repository URL.
>>
>> I have created the db in above location, pushed few files and
>> commited them as well.
>
> Try D:/Git-test first.
>
> Otherwise it might heavily depend on how Jenkins interprets those URLs
> and whether it even uses stock Git to access the repository (and not
> something else like JGit).
>

Jenkins Git plugin uses Git-for-Windows CLI by default. You should be
safe using any URL which works for git CLI locally. If not, I suggest
filing a bug against the Jenkins git plugin to help ensure it gets
fixed :)

Regards,
Jake
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Local git repository url

2015-11-19 Thread Konstantin Khomoutov
On Thu, 19 Nov 2015 10:48:51 +
"Vambara, JayaPrakash (Infosys)" 
wrote:

> I am trying to setup a local git repository and manage it from local
> Jenkins set-up. So, both Jenkins and git are on my local desktop.
> 
> However, I am trying to give the Repository URL but with no luck.
> 
> My repository is in D drive in location D:\Git-Try
> 
> I tried to configure this Repository URL as --- file:///d/Git-Try
>  also file:///D:\Git-Try , but was not successful.
> 
> Can you please let me know what should be the Repository URL.
> 
> I have created the db in above location, pushed few files and
> commited them as well.

Try D:/Git-test first.

Otherwise it might heavily depend on how Jenkins interprets those URLs
and whether it even uses stock Git to access the repository (and not
something else like JGit).

To first rule out an issue with Jenkins you might just try cloning that
Git repo (local to local -- Git is fine with it).  Once you figure out
an URL which works for native Git (I assume you're talking about Git
for Windows), you can try to stick it to Jenkins and see it it works.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 00/10] refs backend pre-vtable

2015-11-19 Thread Jeff King
On Mon, Nov 16, 2015 at 01:51:08PM -0500, David Turner wrote:

> > Since patch 01/11 of v7 was omitted, the patches in this version are
> > numbered differently. In particular, it is now patches 01 through 07
> > that form the core of this patch series. The last three patches can
> > easily be postponed if that will speed the progress of the first
> > seven.
> > 
> > These patches are also available from my GitHub fork [2] as branch
> > "refs-backend-pre-vtable".
> 
> This version looks good to me.

Thanks. Looks like patch 7 didn't make it to the list due to its size. I
picked it up from Michael's GitHub fork.

Just so I'm sure, this is replacing all of what Junio had queued in
dt/refs-backend-pre-vtable, right?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] blame: avoid checking if a file exists on the working tree if a revision is provided

2015-11-19 Thread Eric Sunshine
On Tue, Nov 17, 2015 at 6:22 PM, Jeff King  wrote:
> On Tue, Nov 17, 2015 at 06:01:25PM -0500, Eric Sunshine wrote:
>> On Tue, Nov 17, 2015 at 5:48 PM, Jeff King  wrote:
>> > Hmm. Out of curiosity I tried:
>> >
>> >   git blame v2.4.0 -- t/t6031-merge-recursive.sh
>> >
>> > and it segfaults. This bisects to Max's recent 1b0d400 (blame: extract
>> > find_single_final, 2015-10-30), but I do not see anything obviously
>> > wrong with it from a quick glance.
>>
>> In the original code, sb->final received was assigned value of obj,
>> which may have gone through deref_tag(), however, after 1b0d400,
>> sb->final is unconditionally assigned the original value of obj, not
>> the (potentially) deref'd value.
>
> Good eye. I fed it a tag, find_single_final knows that points to a
> commit, then prepare_final casts the tag object to a commit. Whoops.
>
> The patch below fixes it for me. It probably needs a test, but I have to
> run for the moment.

Sorry for the late response. This patch mirrors my thoughts on fixing
the bug, and appears correct. For what it's worth:

Reviewed-by: Eric Sunshine 

> -- >8 --
> Subject: [PATCH] blame: fix object casting regression
>
> Commit 1b0d400 refactored the prepare_final() function so
> that it could be reused in multiple places. Originally, the
> loop had two outputs: a commit to stuff into sb->final, and
> the name of the commit from the rev->pending array.
>
> After the refactor, that loop is put in its own function
> with a single return value: the object_array_entry from the
> rev->pending array. This contains both the name and the object,
> but with one important difference: the object is the
> _original_ object found by the revision parser, not the
> dereferenced commit. If one feeds a tag to "git blame", we
> end up casting the tag object to a "struct commit", which
> causes a segfault.
>
> Instead, let's return the commit (properly casted) directly
> from the function, and take the "name" as an optional
> out-parameter. This does the right thing, and actually
> simplifies the callers, who no longer need to cast or
> dereference the object_array_entry themselves.
>
> Signed-off-by: Jeff King 
> ---
>  builtin/blame.c | 30 ++
>  1 file changed, 14 insertions(+), 16 deletions(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index ac36738..2184e39 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -2403,10 +2403,12 @@ static struct commit *fake_working_tree_commit(struct 
> diff_options *opt,
> return commit;
>  }
>
> -static struct object_array_entry *find_single_final(struct rev_info *revs)
> +static struct commit *find_single_final(struct rev_info *revs,
> +   const char **name_p)
>  {
> int i;
> -   struct object_array_entry *found = NULL;
> +   struct commit *found = NULL;
> +   const char *name = NULL;
>
> for (i = 0; i < revs->pending.nr; i++) {
> struct object *obj = revs->pending.objects[i].item;
> @@ -2418,22 +2420,20 @@ static struct object_array_entry 
> *find_single_final(struct rev_info *revs)
> die("Non commit %s?", revs->pending.objects[i].name);
> if (found)
> die("More than one commit to dig from %s and %s?",
> -   revs->pending.objects[i].name,
> -   found->name);
> -   found = &(revs->pending.objects[i]);
> +   revs->pending.objects[i].name, name);
> +   found = (struct commit *)obj;
> +   name = revs->pending.objects[i].name;
> }
> +   if (name_p)
> +   *name_p = name;
> return found;
>  }
>
>  static char *prepare_final(struct scoreboard *sb)
>  {
> -   struct object_array_entry *found = find_single_final(sb->revs);
> -   if (found) {
> -   sb->final = (struct commit *) found->item;
> -   return xstrdup(found->name);
> -   } else {
> -   return NULL;
> -   }
> +   const char *name;
> +   sb->final = find_single_final(sb->revs, );
> +   return xstrdup_or_null(name);
>  }
>
>  static char *prepare_initial(struct scoreboard *sb)
> @@ -2721,11 +2721,9 @@ parse_done:
> die("Cannot use --contents with final commit object name");
>
> if (reverse && revs.first_parent_only) {
> -   struct object_array_entry *entry = find_single_final(sb.revs);
> -   if (!entry)
> +   final_commit = find_single_final(sb.revs, NULL);
> +   if (!final_commit)
> die("--reverse and --first-parent together require 
> specified latest commit");
> -   else
> -   final_commit = (struct commit*) entry->item;
> }
>
> /*
> --
> 2.6.3.636.g1460207
>
--
To unsubscribe from this list: send 

Re: [PATCH 0/7] Modernize t9300-fast-import

2015-11-19 Thread Eric Sunshine
On Thu, Nov 19, 2015 at 2:09 PM, Johannes Sixt  wrote:
> Some time ago, I had to dig into t9300-fast-import and found it quite
> unhelpful that it does not follow our modern best-practices. This series
> brings it up-to-date. I thought I submit it now while it is quiet in
> the area.
>
> The larger patches are best viewed using -w -color-words because the
> regular patch text is ... overwhelming.

For what it's worth, I read through the series (with care, I hope) and
didn't find anything amiss.

> Improving shell coding style is outside the scope of this series. I mean
> fixing eyesores such as 'cat >foo < bar', or minor
> things such as quoting <<\EOF when the here-doc does not require
> substitutions.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] t1450: add tests for NUL in headers of commits and tags

2015-11-19 Thread René Scharfe
Signed-off-by: Rene Scharfe 
---
 t/t1450-fsck.sh | 32 
 1 file changed, 32 insertions(+)

diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index dc09797..6c96953 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -176,6 +176,18 @@ test_expect_success 'integer overflow in timestamps is 
reported' '
grep "error in commit $new.*integer overflow" out
 '
 
+test_expect_success 'commit with NUL in header' '
+   git cat-file commit HEAD >basis &&
+   sed "s/author ./author Q/" commit-NUL-header &&
+   new=$(git hash-object -t commit -w --stdin out &&
+   cat out &&
+   grep "error in commit $new.*unterminated header: NUL at offset" out
+'
+
 test_expect_success 'malformatted tree object' '
test_when_finished "git update-ref -d refs/tags/wrong" &&
test_when_finished "remove_object \$T" &&
@@ -276,6 +288,26 @@ test_expect_success 'tag with bad tagger' '
grep "error in tag .*: invalid author/committer" out
 '
 
+test_expect_failure 'tag with NUL in header' '
+   sha=$(git rev-parse HEAD) &&
+   q_to_nul >tag-NUL-header <<-EOF &&
+   object $sha
+   type commit
+   tag contains-Q-in-header
+   tagger T A Gger  1234567890 -
+
+   This is an invalid tag.
+   EOF
+
+   tag=$(git hash-object --literally -t tag -w --stdin .git/refs/tags/wrong &&
+   test_when_finished "git update-ref -d refs/tags/wrong" &&
+   test_must_fail git fsck --tags 2>out &&
+   cat out &&
+   grep "error in tag $tag.*unterminated header: NUL at offset" out
+'
+
 test_expect_success 'cleaned up' '
git fsck >actual 2>&1 &&
test_cmp empty actual
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] fsck: treat a NUL in a tag header as an error

2015-11-19 Thread René Scharfe
We check the return value of verify_header() for commits already, so do
the same for tags as well.

Signed-off-by: Rene Scharfe 
---
 fsck.c  | 3 ++-
 t/t1450-fsck.sh | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fsck.c b/fsck.c
index e41e753..4060f1f 100644
--- a/fsck.c
+++ b/fsck.c
@@ -711,7 +711,8 @@ static int fsck_tag_buffer(struct tag *tag, const char 
*data,
}
}
 
-   if (verify_headers(buffer, size, >object, options))
+   ret = verify_headers(buffer, size, >object, options);
+   if (ret)
goto done;
 
if (!skip_prefix(buffer, "object ", )) {
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 6c96953..e66b7cb 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -288,7 +288,7 @@ test_expect_success 'tag with bad tagger' '
grep "error in tag .*: invalid author/committer" out
 '
 
-test_expect_failure 'tag with NUL in header' '
+test_expect_success 'tag with NUL in header' '
sha=$(git rev-parse HEAD) &&
q_to_nul >tag-NUL-header <<-EOF &&
object $sha
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 00/10] refs backend pre-vtable

2015-11-19 Thread Michael Haggerty
On November 19, 2015 3:58:48 PM GMT+01:00, Jeff King  wrote:
> [...]
>Thanks. Looks like patch 7 didn't make it to the list due to its size.
>I picked it up from Michael's GitHub fork.

Oh, thanks. I hadn't noticed the problem.

>Just so I'm sure, this is replacing all of what Junio had queued in
>dt/refs-backend-pre-vtable, right?

That is correct.

Michael

Sent from a cellphone. Sorry for any screwed-up formatting. See below.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2] ident.c: add support for IPv6

2015-11-19 Thread Elia Pinto
Add IPv6 support by implementing name resolution with the
protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
code is still available when git is compiled with NO_IPV6.

Signed-off-by: Elia Pinto 
Helped-by: Jeff King  
Helped-by: Eric Sunshine 
---
This is the second version of the patch ($gmane/280488)
Changes from previous:

- Simplified the implementation, avoiding the duplication of 
the function add_domainname (Jeff King) ($gmane/280512)

- Fixed a possible memory leak with getaddrinfo (Eric Sunshine)
  ($gmane/280507)


 ident.c | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/ident.c b/ident.c
index 5ff1aad..283e83f 100644
--- a/ident.c
+++ b/ident.c
@@ -73,7 +73,12 @@ static int add_mailname_host(struct strbuf *buf)
 static void add_domainname(struct strbuf *out)
 {
char buf[1024];
+#ifndef NO_IPV6
+   struct addrinfo hints, *ai;
+   int gai;
+#else
struct hostent *he;
+#endif /* NO_IPV6 */
 
if (gethostname(buf, sizeof(buf))) {
warning("cannot get host name: %s", strerror(errno));
@@ -82,10 +87,23 @@ static void add_domainname(struct strbuf *out)
}
if (strchr(buf, '.'))
strbuf_addstr(out, buf);
-   else if ((he = gethostbyname(buf)) && strchr(he->h_name, '.'))
-   strbuf_addstr(out, he->h_name);
-   else
-   strbuf_addf(out, "%s.(none)", buf);
+   else{
+#ifndef NO_IPV6
+   memset (, '\0', sizeof (hints));
+   hints.ai_flags = AI_CANONNAME;
+   if (!(gai = getaddrinfo(buf, NULL, , )) && ai && 
strchr(ai->ai_canonname, '.')) 
+   strbuf_addstr(out, ai->ai_canonname);
+#else
+   if ((he = gethostbyname(buf)) && strchr(he->h_name, '.'))
+   strbuf_addstr(out, he->h_name);
+#endif /* NO_IPV6 */
+   else
+   strbuf_addf(out, "%s.(none)", buf);
+
+#ifndef NO_IPV6
+   if (gai) freeaddrinfo(ai);
+#endif /* NO_IPV6 */
+   }
 }
 
 static void copy_email(const struct passwd *pw, struct strbuf *email)
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2] ident.c: add support for IPv6

2015-11-19 Thread Jeff King
On Thu, Nov 19, 2015 at 02:54:20PM +0100, Elia Pinto wrote:

> Add IPv6 support by implementing name resolution with the
> protocol agnostic getaddrinfo(3) API. The old gethostbyname(3)
> code is still available when git is compiled with NO_IPV6.
> 
> Signed-off-by: Elia Pinto 
> Helped-by: Jeff King  
> Helped-by: Eric Sunshine 
> ---
> This is the second version of the patch ($gmane/280488)
> Changes from previous:
> 
> - Simplified the implementation, avoiding the duplication of 
> the function add_domainname (Jeff King) ($gmane/280512)
> 
> - Fixed a possible memory leak with getaddrinfo (Eric Sunshine)
>   ($gmane/280507)

Thanks, this looks much nicer than the last round. I still have a few
comments:

> diff --git a/ident.c b/ident.c
> index 5ff1aad..283e83f 100644
> --- a/ident.c
> +++ b/ident.c
> @@ -73,7 +73,12 @@ static int add_mailname_host(struct strbuf *buf)
>  static void add_domainname(struct strbuf *out)
>  {
>   char buf[1024];
> +#ifndef NO_IPV6
> + struct addrinfo hints, *ai;
> + int gai;
> +#else
>   struct hostent *he;
> +#endif /* NO_IPV6 */

Can we bump these declarations closer to the point of use? I think that
makes it easier to read, as the matching bits are all together.

So this:

> + else{
> +#ifndef NO_IPV6
> + memset (, '\0', sizeof (hints));
> + hints.ai_flags = AI_CANONNAME;
> + if (!(gai = getaddrinfo(buf, NULL, , )) && ai && 
> strchr(ai->ai_canonname, '.')) 
> + strbuf_addstr(out, ai->ai_canonname);
> +#else
> + if ((he = gethostbyname(buf)) && strchr(he->h_name, '.'))
> + strbuf_addstr(out, he->h_name);
> +#endif /* NO_IPV6 */

becomes:

  else {
  #ifndef NO_IPV6
struct addrinfo hints, *ai;
int gai;
if (!(gai = getaddrinfo()...))
  #else
struct hostent *he;
if ((he = gethostbyname()))
  #endif

> + else
> + strbuf_addf(out, "%s.(none)", buf);

This depends on both sides of the #if ending with a hanging "if" clause.
I guess that's OK in such a small function, but I do still wonder if we
can have a helper like:

  static void canonical_name(const char *host, struct strbuf *out)
  {
  #ifndef NO_IPV6
struct addrinfo hints, *ai;
int gai = getaddrinfo(host, NULL, , );
if (!gai && ai && strchr(ai->ai_canonname, '.')) {
strbuf_addstr(out, ai->ai_canonname);
freeaddrinfo(ai);
}
  #else
struct hostent *he = gethostbyname(buf);
if (he && strchr(he->h_name, '.'))
strbuf_addstr(out, he->h_name);
  }

  ...
  canonical_name(buf, out);
  if (!out.len)
strbuf_addf(out, "%s.(none)", buf);

(or possibly have an integer return value from canonical_name instead of
checking the strbuf length).

> +#ifndef NO_IPV6
> + if (gai) freeaddrinfo(ai);
> +#endif /* NO_IPV6 */

Should this be "if (!gai)"?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2] add test to demonstrate that shallow recursive clones fail

2015-11-19 Thread Jeff King
On Wed, Nov 18, 2015 at 03:40:02PM -0800, Terry Parker wrote:

> > +Terry, who did optimize the JGit implementation for bitmaps,
> > as we also had a "lots of refs" hoarder repo, which underperformed
> > before.
> 
> The performance issue with the "hoarder" repo was that the bitmap
> commit selection algorithm in JGit was selecting too many commits and
> the hoarder repo caused OOMs.
> 
> JGit's selection algorithm walks each branch and makes sure commits
> are selected every 100-200 commits for "recent" history and every
> 5000-5100 commits for more distant history. IIUC cgit sorts all commits
> by date and does a similar selection. Since it doesn't attempt to get
> even coverage on each branch, the selected commits may have
> large gaps for a particular branch.

Thanks for the data point. I agree that cgit seems to have the opposite
problem: selecting fewer commits, which gives worse performance at read
time, but no OOM at write time. :)

I suspect there's some low-hanging fruit in tweaking cgit's
implementation, where we might be able to do a better job of hitting
near the tips of tags without having to drastically increase the number
of bitmapped commits. But I haven't looked closely.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 0/6] Add Travis CI support

2015-11-19 Thread Jeff King
On Thu, Nov 19, 2015 at 09:58:05AM +0100, larsxschnei...@gmail.com wrote:

> From: Lars Schneider 
> 
> diff to v5:
> * check if PID file still exists on P4D cleanup (thanks Luke)
> * fix space/tab formatting error
> * add sleep to timeout loops (thanks Luke)
> * replace 'date +%s' with platform independent Python function (thanks Eric 
> and Luke)
> 
> With the patches of this series the Travis CI test stability increases.
> However, as I am "stress testing" the Travis CI infrastructure you can
> see that it is not perfect: https://travis-ci.org/larsxschneider/git/builds

I peeked at a few, and it looks like just p4 tests failing now?

> Nevertheless, I believe that Travis CI integration has still value as
> contributors can test their patches easily on Linux and OS X before
> posting them.
> 
> @junio / @peff: Do you consider merging this?

I think I'd prefer to split it into 3 separate topics (de-flaking
test_must_fail, p4 test improvements, and the Travis file). Then they
can proceed independently. I can take care of that split when applying.

> Lars Schneider (6):
>   implement test_might_fail using a refactored test_must_fail

You mentioned in the v5 cover that this one was from Junio. Should it be
"From: Junio ..." in the pseudo-header?

>   add "ok=sigpipe" to test_must_fail and use it to fix flaky tests

Looks OK.

>   git-p4: retry kill/cleanup operations in tests with timeout
>   git-p4: add p4d timeout in tests
>   git-p4: add trap to kill p4d on test exit

These are all fairly gross, and I don't have p4d to test with myself.
But if we assume they're all necessary, I suppose it's the best we can
do.

>   Add Travis CI support

I'll leave some comments directly in response to this one.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 6/6] Add Travis CI support

2015-11-19 Thread Jeff King
On Thu, Nov 19, 2015 at 09:58:11AM +0100, larsxschnei...@gmail.com wrote:

> From: Lars Schneider 
> 
> The tests are currently executed on "Ubuntu 12.04 LTS Server Edition
> 64 bit" and on "OS X Mavericks" using gcc and clang.
> 
> Perforce and Git-LFS are installed and therefore available for the
> respective tests.

My overall impression is that this is a lot more complicated than I was
expecting. Can we start with something simpler to gain experience with
Travis?  And then we can add in more complexity later.

For example:

> +addons:
> +  apt:
> +packages:
> +- language-pack-is

I doubt most people are running the t0204 right now. Maybe we should
start without it.

> +env:
> +  global:
> +- P4_VERSION="15.1"
> +- GIT_LFS_VERSION="1.0.2"

I know p4 is your area of interest, but from a project perspective, it
seems like an odd choice for the initial set of tests.

> +- DEFAULT_TEST_TARGET=prove
> +- GIT_PROVE_OPTS="--timer --jobs 3"
> +- GIT_TEST_OPTS="--verbose --tee"

These all make sense, I guess.

> +- GETTEXT_ISO_LOCALE=YesPlease
> +- GETTEXT_LOCALE=YesPlease

What are these? I don't think we have any such Makefile knobs. These
look like variables that get used internally by the test suite, but we
shouldn't need to set them.

> +# - GETTEXT_POISON=YesPlease

I'm assuming the "#" means this is commented out. Can we just drop such
cruft?

> +- GIT_TEST_CHAIN_LINT=YesPlease

This is the default, and we don't need to specify it.

> +- GIT_TEST_CLONE_2GB=YesPlease

Is it a good idea to run such an expensive test?

> +  matrix:
> +-
> +  # NO_ICONV=YesPlease

Ditto here on the commenting.

> +- >
> +  NO_CURL=YesPlease

So if I understand correctly, the point of this list is to test
alternate configurations. So compiling without curl makes some sense, I
guess. Though mostly it will just shut off a bunch off tests.

> +  NO_D_INO_IN_DIRENT=YesPlease

But setting platform compat knobs like this seems weird. Nobody sets
this manually. Either your platform has it, or it does not. And we are
already testing on alternate platforms to cover such things.

If there's a specific config setup of interest, it makes sense to me to
try to increase test coverage there. But it feels like you've just
picked a random laundry list of Makefile knobs and tweaked them, without
any sense of whether they even make sense together, or match the
platform.

For instance:

> +  NO_STRCASESTR=YesPlease
> +  NO_STRLCPY=YesPlease

I wouldn't not be surprised if these cause problems building on some
platforms that _do_ have these functions.

> +echo "$(tput setaf 6)Perfoce Server Version$(tput sgr0)";
> +p4d -V | grep Rev.;
> +echo "$(tput setaf 6)Perfoce Client Version$(tput sgr0)";
> +p4 -V | grep Rev.;

s/Perfoce/Perforce/ :)

> +before_script: make configure && ./configure && make --jobs=2

Hmm. I wonder if we actually want to use autoconf here at all; most devs
do not use it, and Git should generally compile out of the box based on
config.mak.uname (and if it doesn't, it would be nice to know).

There may be some optional packages that autoconf helps with, though.


So overall, I dunno. I do not want to create a bunch of work for you in
splitting it up. But I'm hesitant to merge something that has a bunch of
lines that I'm not sure I understand the reasoning for. :-/

I was hoping the first cut could just be telling Travis to run "make
test", without much fanfare beyond that. Maybe that's not realistic.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html