git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [GUILT v4 14/33] Use "git check-ref-format" to validate patch names.
  2014-05-18 21:59  4% ` [GUILT v4 14/33] Use "git check-ref-format" to validate patch names Per Cederqvist
@ 2015-01-22 14:18  0%   ` Jeff Sipek
  0 siblings, 0 replies; 21+ results
From: Jeff Sipek @ 2015-01-22 14:18 UTC (permalink / raw)
  To: Per Cederqvist; +Cc: git

Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

On Sun, May 18, 2014 at 11:59:50PM +0200, Per Cederqvist wrote:
> The valid_patchname now lets "git check-ref-format" do its job instead
> of trying (and failing) to implement the same rules.  See
> git-check-ref-format(1) for a list of the rules.  Re-implement rules
> added to "git check-ref-format" after Git 1.5.0, so that guilt rejects
> the same names no matter what version of Git we are using (but
> versions prior to 1.5.0 are not supported).
> 
> Refer to the git-check-ref-format(1) man page in the error messages
> produced when valid_patchname indicates that the name is bad.
> 
> Added testcases that breaks most of the rules in that man-page.
> 
> Signed-off-by: Per Cederqvist <cederp@opera.com>
> ---
>  guilt                |  46 +++++-
>  guilt-fork           |   2 +-
>  guilt-import         |   2 +-
>  guilt-new            |   2 +-
>  regression/t-025.out | 426 +++++++++++++++++++++++++++++++++++++++++++++++++--
>  regression/t-025.sh  |  12 +-
>  regression/t-032.out |   4 +-
>  7 files changed, 474 insertions(+), 20 deletions(-)
> 
> diff --git a/guilt b/guilt
> index 3fc524e..9567a78 100755
> --- a/guilt
> +++ b/guilt
> @@ -132,14 +132,50 @@ fi
>  # usage: valid_patchname <patchname>
>  valid_patchname()
>  {
> +	# Once we only support Git 1.7.8 and newer, the command below
> +	# could be replaced with:
> +	#
> +	#     git check-ref-format --allow-onelevel "$1"
> +	#
> +	# Instead, we arbitrarily prepend one level.  The result
> +	# should be the same, and this is portable to all existing
> +	# versions of Git.
> +	git check-ref-format a/"$1"
> +	if [ $? -ne 0 ]; then
> +		return 1
> +	fi
> +
> +	# We want to reject all names that Git 2.0.0 rejects.  In case
> +	# we are running an older version, we explicitly check some
> +	# cases that were added to Git after version 1.5.0.  This code
> +	# aims to support Git version 1.5.0 and newer.
> +
> +	# Git 1.7.6.4 and newer rejects the DEL character.
> +	if [ `echo "$1"|tr -d '\177'` != "$1" ]; then
> +		return 1
> +	fi
> +
> +	# Git 1.7.8 and newer rejects refs that start or end with
> +	# slash or contain multiple adjacent slashes.
>  	case "$1" in
> -		/*|./*|../*|*/./*|*/../*|*/.|*/..|*/|*\ *|*\	*)
> +		/*|*/|*//*)
>  			return 1;;
> -		*:*)
> -			return 1;;
> -		*)
> -			return 0;;
>  	esac
> +
> +	# Git 1.7.8 and newer rejects refname components that end in
> +	# .lock.
> +	case "$1" in
> +		*.lock/*|*.lock)
> +			return 1;;
> +	esac
> +
> +	# Git 1.8.5 and newer rejects refnames that are made up of the
> +	# single character "@".
> +	if [ "$1" = "@" ]; then
> +		return 1
> +	fi
> +
> +	return 0
>  }
>  
>  get_branch()
> diff --git a/guilt-fork b/guilt-fork
> index a85d391..6447e55 100755
> --- a/guilt-fork
> +++ b/guilt-fork
> @@ -37,7 +37,7 @@ else
>  fi
>  
>  if ! valid_patchname "$newpatch"; then
> -	die "The specified patch name contains invalid characters (:)."
> +	die "The specified patch name is invalid according to git-check-ref-format(1)."
>  fi
>  
>  if [ -e "$GUILT_DIR/$branch/$newpatch" ]; then
> diff --git a/guilt-import b/guilt-import
> index 3e9b3bb..928e325 100755
> --- a/guilt-import
> +++ b/guilt-import
> @@ -40,7 +40,7 @@ if [ -e "$GUILT_DIR/$branch/$newname" ]; then
>  fi
>  
>  if ! valid_patchname "$newname"; then
> -	die "The specified patch name contains invalid characters (:)."
> +	die "The specified patch name is invalid according to git-check-ref-format(1)."
>  fi
>  
>  # create any directories as needed
> diff --git a/guilt-new b/guilt-new
> index 9528438..9f7fa44 100755
> --- a/guilt-new
> +++ b/guilt-new
> @@ -64,7 +64,7 @@ fi
>  
>  if ! valid_patchname "$patch"; then
>  	disp "Patchname is invalid." >&2
> -	die "it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace"
> +	die "It must follow the rules in git-check-ref-format(1)."
>  fi
>  
>  # create any directories as needed
> diff --git a/regression/t-025.out b/regression/t-025.out
> index 7811ab1..01bc406 100644
> --- a/regression/t-025.out
> +++ b/regression/t-025.out
> @@ -141,7 +141,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new white space
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -211,7 +211,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new /abc
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -235,7 +235,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new ./blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -259,7 +259,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new ../blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -283,7 +283,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/./blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -307,7 +307,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/../blah
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -331,7 +331,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/.
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -355,7 +355,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/..
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> @@ -379,7 +379,415 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
>  r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
>  % guilt new abc/
>  Patchname is invalid.
> -it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new abc.lock
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new a/b.lock/c
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new cr
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new ctrl-a\x01
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new formfeed\f
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new del\x7f
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new tilde~
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new caret^
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new colon:
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new questionmark?
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new asterisk*
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new open[bracket
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new consecutive//slashes
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new trailing-dot.
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new bad@{seq
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new @
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
> +% list_files
> +d .git/patches
> +d .git/patches/master
> +d .git/patches/master/dir
> +d .git/patches/master/dir/subdir
> +d .git/refs/patches
> +d .git/refs/patches/master
> +d .git/refs/patches/master/dir
> +d .git/refs/patches/master/dir/subdir
> +f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
> +f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
> +f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
> +f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
> +f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
> +f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
> +f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
> +r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
> +% guilt new backslash\
> +Patchname is invalid.
> +It must follow the rules in git-check-ref-format(1).
>  % list_files
>  d .git/patches
>  d .git/patches/master
> diff --git a/regression/t-025.sh b/regression/t-025.sh
> index 985fed4..8c439fc 100755
> --- a/regression/t-025.sh
> +++ b/regression/t-025.sh
> @@ -43,7 +43,17 @@ shouldfail guilt new "white space"
>  
>  cmd list_files
>  
> -for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
> +b()
> +{
> +    printf "%b" "$1"
> +}
> +
> +for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \
> +	abc/.. abc/ abc.lock a/b.lock/c `b 'cr\r'` `b 'ctrl-a\001'` \
> +	`b 'formfeed\f'` `b 'del\177'` "tilde~" "caret^" "colon:" \
> +	"questionmark?" "asterisk*" "open[bracket" "consecutive//slashes" \
> +	"trailing-dot." "bad@{seq" "@" "backslash\\"
> +do
>  	shouldfail guilt new "$pname"
>  
>  	cmd list_files
> diff --git a/regression/t-032.out b/regression/t-032.out
> index 53f0370..4e65db0 100644
> --- a/regression/t-032.out
> +++ b/regression/t-032.out
> @@ -1,7 +1,7 @@
>  % setup_repo
>  % touch foo foo:baz
>  % guilt import -P foo:bar foo
> -The specified patch name contains invalid characters (:).
> +The specified patch name is invalid according to git-check-ref-format(1).
>  % guilt import -P foo:bar foo2
>  Specified file does not exist.
>  % guilt import -P foo foo2
> @@ -15,4 +15,4 @@ Already tracking a patch under that name.
>  Already tracking a patch under that name.
>  % guilt import -P foo,bar foo
>  % guilt import foo:baz
> -The specified patch name contains invalid characters (:).
> +The specified patch name is invalid according to git-check-ref-format(1).
> -- 
> 1.8.3.1
> 

-- 
What is the difference between Mechanical Engineers and Civil Engineers?
Mechanical Engineers build weapons, Civil Engineers build targets.

^ permalink raw reply	[relevance 0%]

* [GUILT v4 14/33] Use "git check-ref-format" to validate patch names.
  @ 2014-05-18 21:59  4% ` Per Cederqvist
  2015-01-22 14:18  0%   ` Jeff Sipek
  0 siblings, 1 reply; 21+ results
From: Per Cederqvist @ 2014-05-18 21:59 UTC (permalink / raw)
  To: Jeff Sipek; +Cc: git, Per Cederqvist

The valid_patchname now lets "git check-ref-format" do its job instead
of trying (and failing) to implement the same rules.  See
git-check-ref-format(1) for a list of the rules.  Re-implement rules
added to "git check-ref-format" after Git 1.5.0, so that guilt rejects
the same names no matter what version of Git we are using (but
versions prior to 1.5.0 are not supported).

Refer to the git-check-ref-format(1) man page in the error messages
produced when valid_patchname indicates that the name is bad.

Added testcases that breaks most of the rules in that man-page.

Signed-off-by: Per Cederqvist <cederp@opera.com>
---
 guilt                |  46 +++++-
 guilt-fork           |   2 +-
 guilt-import         |   2 +-
 guilt-new            |   2 +-
 regression/t-025.out | 426 +++++++++++++++++++++++++++++++++++++++++++++++++--
 regression/t-025.sh  |  12 +-
 regression/t-032.out |   4 +-
 7 files changed, 474 insertions(+), 20 deletions(-)

diff --git a/guilt b/guilt
index 3fc524e..9567a78 100755
--- a/guilt
+++ b/guilt
@@ -132,14 +132,50 @@ fi
 # usage: valid_patchname <patchname>
 valid_patchname()
 {
+	# Once we only support Git 1.7.8 and newer, the command below
+	# could be replaced with:
+	#
+	#     git check-ref-format --allow-onelevel "$1"
+	#
+	# Instead, we arbitrarily prepend one level.  The result
+	# should be the same, and this is portable to all existing
+	# versions of Git.
+	git check-ref-format a/"$1"
+	if [ $? -ne 0 ]; then
+		return 1
+	fi
+
+	# We want to reject all names that Git 2.0.0 rejects.  In case
+	# we are running an older version, we explicitly check some
+	# cases that were added to Git after version 1.5.0.  This code
+	# aims to support Git version 1.5.0 and newer.
+
+	# Git 1.7.6.4 and newer rejects the DEL character.
+	if [ `echo "$1"|tr -d '\177'` != "$1" ]; then
+		return 1
+	fi
+
+	# Git 1.7.8 and newer rejects refs that start or end with
+	# slash or contain multiple adjacent slashes.
 	case "$1" in
-		/*|./*|../*|*/./*|*/../*|*/.|*/..|*/|*\ *|*\	*)
+		/*|*/|*//*)
 			return 1;;
-		*:*)
-			return 1;;
-		*)
-			return 0;;
 	esac
+
+	# Git 1.7.8 and newer rejects refname components that end in
+	# .lock.
+	case "$1" in
+		*.lock/*|*.lock)
+			return 1;;
+	esac
+
+	# Git 1.8.5 and newer rejects refnames that are made up of the
+	# single character "@".
+	if [ "$1" = "@" ]; then
+		return 1
+	fi
+
+	return 0
 }
 
 get_branch()
diff --git a/guilt-fork b/guilt-fork
index a85d391..6447e55 100755
--- a/guilt-fork
+++ b/guilt-fork
@@ -37,7 +37,7 @@ else
 fi
 
 if ! valid_patchname "$newpatch"; then
-	die "The specified patch name contains invalid characters (:)."
+	die "The specified patch name is invalid according to git-check-ref-format(1)."
 fi
 
 if [ -e "$GUILT_DIR/$branch/$newpatch" ]; then
diff --git a/guilt-import b/guilt-import
index 3e9b3bb..928e325 100755
--- a/guilt-import
+++ b/guilt-import
@@ -40,7 +40,7 @@ if [ -e "$GUILT_DIR/$branch/$newname" ]; then
 fi
 
 if ! valid_patchname "$newname"; then
-	die "The specified patch name contains invalid characters (:)."
+	die "The specified patch name is invalid according to git-check-ref-format(1)."
 fi
 
 # create any directories as needed
diff --git a/guilt-new b/guilt-new
index 9528438..9f7fa44 100755
--- a/guilt-new
+++ b/guilt-new
@@ -64,7 +64,7 @@ fi
 
 if ! valid_patchname "$patch"; then
 	disp "Patchname is invalid." >&2
-	die "it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace"
+	die "It must follow the rules in git-check-ref-format(1)."
 fi
 
 # create any directories as needed
diff --git a/regression/t-025.out b/regression/t-025.out
index 7811ab1..01bc406 100644
--- a/regression/t-025.out
+++ b/regression/t-025.out
@@ -141,7 +141,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new white space
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -211,7 +211,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new /abc
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -235,7 +235,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new ./blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -259,7 +259,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new ../blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -283,7 +283,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/./blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -307,7 +307,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/../blah
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -331,7 +331,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/.
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -355,7 +355,7 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/..
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
@@ -379,7 +379,415 @@ f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
 r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
 % guilt new abc/
 Patchname is invalid.
-it cannot begin with '/', './' or '../', or contain /./, /../, or whitespace
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new abc.lock
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new a/b.lock/c
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new cr
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new ctrl-a\x01
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new formfeed\f
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new del\x7f
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new tilde~
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new caret^
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new colon:
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new questionmark?
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new asterisk*
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new open[bracket
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new consecutive//slashes
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new trailing-dot.
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new bad@{seq
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new @
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
+% list_files
+d .git/patches
+d .git/patches/master
+d .git/patches/master/dir
+d .git/patches/master/dir/subdir
+d .git/refs/patches
+d .git/refs/patches/master
+d .git/refs/patches/master/dir
+d .git/refs/patches/master/dir/subdir
+f 1ef04b4f4149870b3f06b5f99b9d9fc260cebc67  .git/patches/master/series
+f 22930c6d1f1938f298a4fca51c57e4b47171db21  .git/patches/master/mode
+f 413390f3906f16f30b054a4fb86c1e014b964504  .git/patches/master/remove
+f 7ce0ecd062afe46bf743d0d63dbe79e18774fe03  .git/patches/master/status
+f 9c18cc7abe6b87f18503714a80a677b4094eb457  .git/patches/master/add
+f bc9ab2e0f5db99d483961e956e814d963f0309f8  .git/patches/master/modify
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/append
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/dir/subdir/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/file
+f da39a3ee5e6b4b0d3255bfef95601890afd80709  .git/patches/master/prepend
+r acdeef96ee30eb34bbbf65d11de5cf7da4b5fee8  .git/refs/patches/master/prepend
+% guilt new backslash\
+Patchname is invalid.
+It must follow the rules in git-check-ref-format(1).
 % list_files
 d .git/patches
 d .git/patches/master
diff --git a/regression/t-025.sh b/regression/t-025.sh
index 985fed4..8c439fc 100755
--- a/regression/t-025.sh
+++ b/regression/t-025.sh
@@ -43,7 +43,17 @@ shouldfail guilt new "white space"
 
 cmd list_files
 
-for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. abc/.. abc/ ; do
+b()
+{
+    printf "%b" "$1"
+}
+
+for pname in prepend mode /abc ./blah ../blah abc/./blah abc/../blah abc/. \
+	abc/.. abc/ abc.lock a/b.lock/c `b 'cr\r'` `b 'ctrl-a\001'` \
+	`b 'formfeed\f'` `b 'del\177'` "tilde~" "caret^" "colon:" \
+	"questionmark?" "asterisk*" "open[bracket" "consecutive//slashes" \
+	"trailing-dot." "bad@{seq" "@" "backslash\\"
+do
 	shouldfail guilt new "$pname"
 
 	cmd list_files
diff --git a/regression/t-032.out b/regression/t-032.out
index 53f0370..4e65db0 100644
--- a/regression/t-032.out
+++ b/regression/t-032.out
@@ -1,7 +1,7 @@
 % setup_repo
 % touch foo foo:baz
 % guilt import -P foo:bar foo
-The specified patch name contains invalid characters (:).
+The specified patch name is invalid according to git-check-ref-format(1).
 % guilt import -P foo:bar foo2
 Specified file does not exist.
 % guilt import -P foo foo2
@@ -15,4 +15,4 @@ Already tracking a patch under that name.
 Already tracking a patch under that name.
 % guilt import -P foo,bar foo
 % guilt import foo:baz
-The specified patch name contains invalid characters (:).
+The specified patch name is invalid according to git-check-ref-format(1).
-- 
1.8.3.1

^ permalink raw reply related	[relevance 4%]

* git version statistics
@ 2012-05-31 11:48  4% Jeff King
  0 siblings, 0 replies; 21+ results
From: Jeff King @ 2012-05-31 11:48 UTC (permalink / raw)
  To: git

Just for fun, I've assembled a few statistics on git client versions
that hit github.com. These are collected from the http user-agent
strings provided by smart-http requests (we don't allow dumb http at all
these days, and the git protocol does not provide any version
information). It includes only the git/* entries (which are the vast
majority of clients hitting "info/refs?service=.*"; the second biggest
is JGit/*). And I counted each version only a single time from each IP
(so this would skew if you had a lot of clients behind a single IP;
their version would be counted only once).

Here are the results from the last few days:

  git/1.7.11.x |  0.1%   (0%) | 
  git/1.7.10.x | 21.1%  (21%) | **********************************
  git/1.7.9.x  | 11.4%  (32%) | ******************
  git/1.7.8.x  | 24.1%  (56%) | ****************************************
  git/1.7.7.x  | 12.2%  (68%) | ********************
  git/1.7.6.x  |  1.8%  (70%) | **
  git/1.7.5.x  |  8.2%  (78%) | *************
  git/1.7.4.x  |  7.2%  (86%) | ***********
  git/1.7.3.x  |  1.9%  (87%) | ***
  git/1.7.2.x  |  3.0%  (90%) | ****
  git/1.7.1.x  |  2.1%  (93%) | ***
  git/1.7.0.x  |  7.0%  (99%) | ***********
  git/1.6.6.x  |  0.0% (100%) | 

In this table, I've collapsed all of the x.y.z.* versions into a single
string to get an overview (a more detailed table is below). The first
percentage is the portion of the total requests; the second is a
cumulative portion (so, for example, 90% of clients are running v1.7.2.x
or higher, though only 3% are running v1.7.2.x itself).

Note that these numbers are skewed away from git versions lower than
v1.6.6, because that is when we added smart http support. Requests over
git:// or ssh are not included at all in these results.

For comparison, here's the same table from mid-September of 2011 (v1.7.7
was in -rc1 at the time):

  git/1.7.7.x |  0.2%   (0%) | 
  git/1.7.6.x | 19.3%  (19%) | *****************
  git/1.7.5.x |  8.0%  (27%) | *******
  git/1.7.4.x | 43.8%  (71%) | ****************************************
  git/1.7.3.x | 10.7%  (82%) | *********
  git/1.7.2.x |  4.9%  (86%) | ****
  git/1.7.1.x |  4.7%  (91%) | ****
  git/1.7.0.x |  8.2%  (99%) | *******
  git/1.6.6.x |  0.1% (100%) | 

So it seems that a large proportion of git users (or at least github
users) stay within a few versions of the most current. In both cases,
70% are within 4 major releases of the most recent version.

Here's a more detailed table (from recent data), showing individual
w.x.y.z versions:

  git/1.7.10.3 |  3.6%   (3%) | *******
  git/1.7.10.2 |  4.4%   (8%) | *********
  git/1.7.10.1 |  1.5%   (9%) | ***
  git/1.7.10   |  2.4%  (11%) | *****
  git/1.7.9.6  |  0.2%  (12%) | 
  git/1.7.9.5  |  9.2%  (21%) | *******************
  git/1.7.9.4  |  1.2%  (22%) | **
  git/1.7.9.3  |  0.3%  (22%) | 
  git/1.7.9.2  |  0.4%  (23%) | 
  git/1.7.9.1  |  0.4%  (23%) | 
  git/1.7.9    |  1.1%  (24%) | **
  git/1.7.8.6  |  0.3%  (25%) | 
  git/1.7.8.5  |  0.0%  (25%) | 
  git/1.7.8.4  |  0.7%  (25%) | *
  git/1.7.8.3  | 12.2%  (38%) | *************************
  git/1.7.8.2  | 18.8%  (56%) | ****************************************
  git/1.7.8.1  |  0.1%  (56%) | 
  git/1.7.8    |  0.3%  (57%) | 
  git/1.7.7.6  |  0.5%  (57%) | *
  git/1.7.7.4  |  0.2%  (57%) | 
  git/1.7.7.3  |  0.4%  (58%) | 
  git/1.7.7.2  |  0.1%  (58%) | 
  git/1.7.7.1  |  0.0%  (58%) | 
  git/1.7.7    |  0.7%  (59%) | *
  git/1.7.6.5  |  0.1%  (59%) | 
  git/1.7.6.4  |  0.2%  (59%) | 
  git/1.7.6.3  |  0.0%  (59%) | 
  git/1.7.6.1  |  0.5%  (59%) | *
  git/1.7.6    |  0.7%  (60%) | *
  git/1.7.5.4  | 10.9%  (71%) | ***********************
  git/1.7.5.3  |  0.1%  (71%) | 
  git/1.7.5.2  |  0.1%  (71%) | 
  git/1.7.5.1  |  0.2%  (71%) | 
  git/1.7.5    |  0.1%  (71%) | 
  git/1.7.4.5  |  0.4%  (72%) | 
  git/1.7.4.4  |  3.3%  (75%) | *******
  git/1.7.4.3  |  0.0%  (75%) | 
  git/1.7.4.2  |  0.0%  (75%) | 
  git/1.7.4.1  |  5.3%  (81%) | ***********
  git/1.7.4    |  0.2%  (81%) | 
  git/1.7.3.5  |  0.2%  (81%) | 
  git/1.7.3.4  |  1.2%  (82%) | **
  git/1.7.3.3  |  0.1%  (82%) | 
  git/1.7.3.2  |  0.4%  (83%) | 
  git/1.7.3.1  |  0.1%  (83%) | 
  git/1.7.3    |  0.1%  (83%) | 
  git/1.7.2.5  |  3.6%  (86%) | *******
  git/1.7.2.3  |  0.3%  (87%) | 
  git/1.7.2.2  |  0.1%  (87%) | 
  git/1.7.2.1  |  0.0%  (87%) | 
  git/1.7.2    |  0.1%  (87%) | 
  git/1.7.1.1  |  0.1%  (87%) | 
  git/1.7.1    |  2.8%  (90%) | ******
  git/1.7.0.6  |  0.0%  (90%) | 
  git/1.7.0.5  |  0.0%  (90%) | 
  git/1.7.0.4  |  7.0%  (97%) | **************
  git/1.7.0    |  2.6%  (99%) | *****
  git/1.6.6    |  0.0% (100%) | 

The interesting thing to me is how spiky it is, and where the spikes
fall. I would expect to see a spike around the highest maint release of
each major version (so v1.7.8.6, for example, with many fewer installs
of v1.7.8.5, v1.7.8.4, and so forth). But that's not what happens. The
most popular v1.7.8.x versions are .3 and .2, and hardly anybody
bothered to move to v1.7.8.6.

I can only assume these are skewed by some widely-used binary
distribution being locked onto particular versions (e.g., the spike at
v1.7.2.5 represents Debian stable).

If anybody has suggestions for other interesting analyses to perform,
let me know.

-Peff

^ permalink raw reply	[relevance 4%]

* Re: Infinite loop in cascade_filter_fn()
  2011-11-23 17:40  6% Infinite loop in cascade_filter_fn() Henrik Grubbström
  2011-11-25 14:31  0% ` Carlos Martín Nieto
@ 2011-11-25 15:38  0% ` Carlos Martín Nieto
  1 sibling, 0 replies; 21+ results
From: Carlos Martín Nieto @ 2011-11-25 15:38 UTC (permalink / raw)
  To: Henrik Grubbström; +Cc: Git Mailing list, Junio C Hamano

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

On Wed, Nov 23, 2011 at 06:40:47PM +0100, Henrik Grubbström wrote:
> Hi.
> 
> My git repository walker just got bitten by what seems to be a
> reasonably new bug in convert.c:cascade_filter_fn() (git 1.7.8.rc3
> (gentoo)).
> 
> How to reproduce:
> 
>   git clone git@github.com:pikelang/Pike.git
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca^
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca
> 
> The first two commands complete as expected, while the last hangs forever.
> Performing the same with git 1.7.6.4 works as expected.
> 
> The problematic file seems to be
> /src/modules/_Crypto/rijndael_ecb_vt.txt which has the attributes:
> text ident eol=crlf

It looks like you won the lottery. The problem was that the output
buffer only has one byte available when we see a LF. We check whether
there is enough space (two bytes) to store CRLF in the output buffer,
see that there isn't and return. cascade_filter_fn sees that the
buffer hasn't been written fully and calls lf_to_crlf_filter_fn with
the same output buffer, which we still can't fill, because it's too
short.

This patch fixes this, but I think it would still break if the LF is
at the end of the file. Changing the `if (!input)` to put the LF in
the output buffer may or may not be the right soulution. I feel like
this should be handled by cascade_filter_fn rather than the actual
filter somehow, but Junio's comment (4ae66704 'stream filter: add "no
more input" to the filters') suggests otherwise.

I'm working on a cleaner patch that takes care of a bit of state, but
this is the general idea.

   cmn
--- 8< ---
Subject: [PATCH] convert: don't loop indefintely if at LF-to-CRLF streaming

If we find a LF when the output buffer is only has one byte remaining,
cascade_filter_fn won't notice that we need more input and won't drain
the output buffer.

In such a case, store whether we've outputted the CR so we can retake
it from there.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
---
 convert.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/convert.c b/convert.c
index 86e9c29..4218f40 100644
--- a/convert.c
+++ b/convert.c
@@ -881,6 +881,7 @@ static int lf_to_crlf_filter_fn(struct stream_filter *filter,
 				char *output, size_t *osize_p)
 {
 	size_t count;
+	static int put_cr = 0;
 
 	if (!input)
 		return 0; /* we do not keep any states */
@@ -890,10 +891,14 @@ static int lf_to_crlf_filter_fn(struct stream_filter *filter,
 		for (i = o = 0; o < *osize_p && i < count; i++) {
 			char ch = input[i];
 			if (ch == '\n') {
-				if (o + 1 < *osize_p)
+				if (put_cr) {
+					put_cr = 0;
+				} else {
 					output[o++] = '\r';
-				else
-					break;
+					put_cr = 1;
+					i--;
+					continue;
+				}
 			}
 			output[o++] = ch;
 		}
-- 
1.7.8.rc3.31.g017d1


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply related	[relevance 0%]

* Re: Infinite loop in cascade_filter_fn()
  2011-11-23 17:40  6% Infinite loop in cascade_filter_fn() Henrik Grubbström
@ 2011-11-25 14:31  0% ` Carlos Martín Nieto
  2011-11-25 15:38  0% ` Carlos Martín Nieto
  1 sibling, 0 replies; 21+ results
From: Carlos Martín Nieto @ 2011-11-25 14:31 UTC (permalink / raw)
  To: Henrik Grubbström; +Cc: Git Mailing list, Junio C Hamano

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

On Wed, Nov 23, 2011 at 06:40:47PM +0100, Henrik Grubbström wrote:
> Hi.
> 
> My git repository walker just got bitten by what seems to be a
> reasonably new bug in convert.c:cascade_filter_fn() (git 1.7.8.rc3
> (gentoo)).

It looks like it's a bug between cascade_filter_fn and the actual
filter function lf_to_crlf_filter_fn that gets triggered when the
output buffer is too small. In this particular case, *isize_p=378 and
*osize_p=1 which causes cascade_filter_fn to feed the filter data
which it can't process because it doesn't have anywhere to put it.

I think that the function assumes that the output buffer is always
large enough, but there are many indirections, so it might be an
off-by-one.

> 
> How to reproduce:
> 
>   git clone git@github.com:pikelang/Pike.git
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca^
> 
>   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca
> 
> The first two commands complete as expected, while the last hangs forever.
> Performing the same with git 1.7.6.4 works as expected.
> 
> The problematic file seems to be
> /src/modules/_Crypto/rijndael_ecb_vt.txt which has the attributes:
> text ident eol=crlf
> 
> Thanks,
> 
> --
> Henrik Grubbström					grubba@grubba.org
> Roxen Internet Software AB				grubba@roxen.com


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[relevance 0%]

* Infinite loop in cascade_filter_fn()
@ 2011-11-23 17:40  6% Henrik Grubbström
  2011-11-25 14:31  0% ` Carlos Martín Nieto
  2011-11-25 15:38  0% ` Carlos Martín Nieto
  0 siblings, 2 replies; 21+ results
From: Henrik Grubbström @ 2011-11-23 17:40 UTC (permalink / raw)
  To: Git Mailing list; +Cc: Junio C Hamano

[-- Attachment #1: Type: TEXT/PLAIN, Size: 689 bytes --]

Hi.

My git repository walker just got bitten by what seems to be a reasonably 
new bug in convert.c:cascade_filter_fn() (git 1.7.8.rc3 (gentoo)).

How to reproduce:

   git clone git@github.com:pikelang/Pike.git

   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca^

   git checkout -f 0e2080f838c6f0bc7d670ac7549676a353451dca

The first two commands complete as expected, while the last hangs forever.
Performing the same with git 1.7.6.4 works as expected.

The problematic file seems to be /src/modules/_Crypto/rijndael_ecb_vt.txt 
which has the attributes: text ident eol=crlf

Thanks,

--
Henrik Grubbström					grubba@grubba.org
Roxen Internet Software AB				grubba@roxen.com

^ permalink raw reply	[relevance 6%]

* Incremental use of fast-import may cause conflicting notes
@ 2011-11-23 12:09  5% Henrik Grubbström
  2011-11-23 12:10  0% ` Henrik Grubbström
  0 siblings, 1 reply; 21+ results
From: Henrik Grubbström @ 2011-11-23 12:09 UTC (permalink / raw)
  To: Git Mailing list; +Cc: Johan Herland, Jonathan Nieder

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1318 bytes --]

Hi.

Background: I have an incremental repository-walker creating a 
corresponding documentation repository from a source repository
that uses git-notes to store its state, a use for which notes
seem very suitable.

Problem: When the number of notes in the root of the notes branch
increases beyond a threshold, fast-import changes the fanout. This 
is as designed, but the problem is that when fast-import is restarted
it won't remember the fanout, and will start writing files in the root 
again. This means that there may be multiple notes-files for the same 
commit, eg both de/adbeef and deadbeef.

This is not what the user expects, and is not good practice, even if it in 
this case actually works, since the latter is defined to have priority.
I'm however not sure if eg fast_import.c:do_change_note_fanout() will do 
the right thing if/when the fanout is changed again.

The problem is probably due to b->num_notes not being initialized properly 
when the old non-empty root commit for the notes branch is loaded in 
parse_from()/parse_new_commit().

My workaround for now is to use filedeleteall and restore all the notes
by hand in the first new commit on the notes branch.

Version of git: 1.7.6.4 (gentoo)

Thanks,

--
Henrik Grubbström					grubba@grubba.org
Roxen Internet Software AB				grubba@roxen.com

^ permalink raw reply	[relevance 5%]

* Re: Incremental use of fast-import may cause conflicting notes
  2011-11-23 12:09  5% Incremental use of fast-import may cause conflicting notes Henrik Grubbström
@ 2011-11-23 12:10  0% ` Henrik Grubbström
  0 siblings, 0 replies; 21+ results
From: Henrik Grubbström @ 2011-11-23 12:10 UTC (permalink / raw)
  To: Git Mailing list; +Cc: Johan Herland, Jonathan Nieder

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1437 bytes --]

On Wed, 23 Nov 2011, Henrik Grubbström wrote:

> Hi.
>
> Background: I have an incremental repository-walker creating a corresponding 
> documentation repository from a source repository
> that uses git-notes to store its state, a use for which notes
> seem very suitable.
>
> Problem: When the number of notes in the root of the notes branch
> increases beyond a threshold, fast-import changes the fanout. This is as 
> designed, but the problem is that when fast-import is restarted
> it won't remember the fanout, and will start writing files in the root again. 
> This means that there may be multiple notes-files for the same commit, eg 
> both de/adbeef and deadbeef.
>
> This is not what the user expects, and is not good practice, even if it in 
> this case actually works, since the latter is defined to have priority.
> I'm however not sure if eg fast_import.c:do_change_note_fanout() will do the 
> right thing if/when the fanout is changed again.
>
> The problem is probably due to b->num_notes not being initialized properly 
> when the old non-empty root commit for the notes branch is loaded in 
> parse_from()/parse_new_commit().
>
> My workaround for now is to use filedeleteall and restore all the notes
> by hand in the first new commit on the notes branch.
>
> Version of git: 1.7.6.4 (gentoo)

Oops, wrong machine... 1.7.8.rc3 (gentoo)

> Thanks,

--
Henrik Grubbström					grubba@roxen.com
Roxen Internet Software AB

^ permalink raw reply	[relevance 0%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 17:01  0%     ` Matthieu Moy
@ 2011-10-25 18:10  0%       ` Eugene Sajine
  0 siblings, 0 replies; 21+ results
From: Eugene Sajine @ 2011-10-25 18:10 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Junio C Hamano, git

On Tue, Oct 25, 2011 at 1:01 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Eugene Sajine <euguess@gmail.com> writes:
>
>> On Tue, Oct 25, 2011 at 12:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>
>>> Just a wild guess. perhaps you specified prefix=/usr/local/git-1.7.4.1/
>>> eons ago when you built and installed 1.7.4.1 like this:
>>>
>>>    make prefix=/usr/local/git-1.7.4.1 all install
>>>
>>> and then you did it differently when you installed 1.7.6.4, e.g.
>>>
>>>    make all
>>>    make prefix=/usr/local/git-1.7.6.4 install
>>>
>>>
>>
>>
>> Are you saying that the first command is more correct?
>> I will check it.
>
> At build time, Git registers the "exec path" (i.e. where to find
> git-<command> executables). So, if you run "make all" without specifying
> the install path, Git will set an arbitrary exec-path, and the
> installation won't work.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>

Matthieu/Junio,

Thank you very much for your help - there was a mistake made during
the build where the exec path folder was incorrect and unreachable.

Thanks!

^ permalink raw reply	[relevance 0%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 16:52  0%   ` Eugene Sajine
@ 2011-10-25 17:01  0%     ` Matthieu Moy
  2011-10-25 18:10  0%       ` Eugene Sajine
  0 siblings, 1 reply; 21+ results
From: Matthieu Moy @ 2011-10-25 17:01 UTC (permalink / raw)
  To: Eugene Sajine; +Cc: Junio C Hamano, git

Eugene Sajine <euguess@gmail.com> writes:

> On Tue, Oct 25, 2011 at 12:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Just a wild guess. perhaps you specified prefix=/usr/local/git-1.7.4.1/
>> eons ago when you built and installed 1.7.4.1 like this:
>>
>>    make prefix=/usr/local/git-1.7.4.1 all install
>>
>> and then you did it differently when you installed 1.7.6.4, e.g.
>>
>>    make all
>>    make prefix=/usr/local/git-1.7.6.4 install
>>
>>
>
>
> Are you saying that the first command is more correct?
> I will check it.

At build time, Git registers the "exec path" (i.e. where to find
git-<command> executables). So, if you run "make all" without specifying
the install path, Git will set an arbitrary exec-path, and the
installation won't work.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[relevance 0%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 16:45  7% ` Junio C Hamano
@ 2011-10-25 16:52  0%   ` Eugene Sajine
  2011-10-25 17:01  0%     ` Matthieu Moy
  0 siblings, 1 reply; 21+ results
From: Eugene Sajine @ 2011-10-25 16:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Oct 25, 2011 at 12:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eugene Sajine <euguess@gmail.com> writes:
>
>> We have built git 1.7.6.4 and we have a following problem with it:
>> .,,
>> It doesn't seem to be the case with 1.7.4.1
>>
>> Was there any change between those versions that i missed, or may be
>> there is some property we have to specify during build?
>
> Nothing I can think of offhand that you need to specify _differently_
> between the build procedures of these two versions.
>
> Just a wild guess. perhaps you specified prefix=/usr/local/git-1.7.4.1/
> eons ago when you built and installed 1.7.4.1 like this:
>
>    make prefix=/usr/local/git-1.7.4.1 all install
>
> and then you did it differently when you installed 1.7.6.4, e.g.
>
>    make all
>    make prefix=/usr/local/git-1.7.6.4 install
>
>


Are you saying that the first command is more correct?
I will check it.

Thanks a lot,
Eugene

^ permalink raw reply	[relevance 0%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 16:27  0% ` Matthieu Moy
@ 2011-10-25 16:50  0%   ` Eugene Sajine
  0 siblings, 0 replies; 21+ results
From: Eugene Sajine @ 2011-10-25 16:50 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

On Tue, Oct 25, 2011 at 12:27 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Eugene Sajine <euguess@gmail.com> writes:
>
>> Hi,
>>
>>
>> We have built git 1.7.6.4 and we have a following problem with it:
>
> Which command did you use to compile it? What does
>
>  git --exec-path
>
> say?
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>

I was not building it myself so i cannot say what command exactly was
used, but i will check it.
OTOH git --exec-path shows:
for version 1.7.4.1 that works properly -
/usr/local/git-1.7.4.1/libexec/git-core
For version 1.7.6.4 libexec is located in some other folder...

Let me check what is this all about.

Thanks,
Eugene

^ permalink raw reply	[relevance 0%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 15:58  9% pull is not a git command - 1.7.6.4 Eugene Sajine
  2011-10-25 16:27  0% ` Matthieu Moy
@ 2011-10-25 16:45  7% ` Junio C Hamano
  2011-10-25 16:52  0%   ` Eugene Sajine
  1 sibling, 1 reply; 21+ results
From: Junio C Hamano @ 2011-10-25 16:45 UTC (permalink / raw)
  To: Eugene Sajine; +Cc: git

Eugene Sajine <euguess@gmail.com> writes:

> We have built git 1.7.6.4 and we have a following problem with it:
> .,,
> It doesn't seem to be the case with 1.7.4.1
>
> Was there any change between those versions that i missed, or may be
> there is some property we have to specify during build?

Nothing I can think of offhand that you need to specify _differently_
between the build procedures of these two versions.

Just a wild guess. perhaps you specified prefix=/usr/local/git-1.7.4.1/
eons ago when you built and installed 1.7.4.1 like this:

    make prefix=/usr/local/git-1.7.4.1 all install

and then you did it differently when you installed 1.7.6.4, e.g.

    make all
    make prefix=/usr/local/git-1.7.6.4 install

^ permalink raw reply	[relevance 7%]

* Re: pull is not a git command - 1.7.6.4
  2011-10-25 15:58  9% pull is not a git command - 1.7.6.4 Eugene Sajine
@ 2011-10-25 16:27  0% ` Matthieu Moy
  2011-10-25 16:50  0%   ` Eugene Sajine
  2011-10-25 16:45  7% ` Junio C Hamano
  1 sibling, 1 reply; 21+ results
From: Matthieu Moy @ 2011-10-25 16:27 UTC (permalink / raw)
  To: Eugene Sajine; +Cc: git

Eugene Sajine <euguess@gmail.com> writes:

> Hi,
>
>
> We have built git 1.7.6.4 and we have a following problem with it:

Which command did you use to compile it? What does

  git --exec-path

say?

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[relevance 0%]

* pull is not a git command - 1.7.6.4
@ 2011-10-25 15:58  9% Eugene Sajine
  2011-10-25 16:27  0% ` Matthieu Moy
  2011-10-25 16:45  7% ` Junio C Hamano
  0 siblings, 2 replies; 21+ results
From: Eugene Sajine @ 2011-10-25 15:58 UTC (permalink / raw)
  To: git

Hi,


We have built git 1.7.6.4 and we have a following problem with it:

It is localted in a folder /usr/local/git-1.7.6.4/
If the user has both /usr/local/git-1.7.6.4/ and
/usr/local/git-1.7.6.4/bin in $PATH variable then git works fine.
If the user doesn't have the upper level folder in the $PATH then git
cannot execute some commands like "git pull".
It says pull is not a git command. Or git gc complains that repack is
not a git command.

It doesn't seem to be the case with 1.7.4.1

Was there any change between those versions that i missed, or may be
there is some property we have to specify during build?

Thanks,
Eugene

^ permalink raw reply	[relevance 9%]

* Re: [PATCH] refs.c: Fix slowness with numerous loose refs
  @ 2011-09-27  2:04  7%   ` David Michael Barr
  0 siblings, 0 replies; 21+ results
From: David Michael Barr @ 2011-09-27  2:04 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Julian Phillips, Martin Fick, Junio C Hamano, David Barr,
	Shawn O. Pearce

+cc Shawn O. Pearce

I used the following to generate a test repo shaped like
a gerrit mirror with unpacked refs (10k, because life is too short for
100k tests):

cd test.git
git init
touch empty
git add empty
git commit -m 'empty'
REV=`git rev-parse HEAD`
for ((d=0;d<100;++d)); do
 for ((n=0;n<100;++n)); do
  let r=n*100+d
  mkdir -p .git/refs/changes/$d/$r
  echo $REV > .git/refs/changes/$d/$r/1
 done
done
time git branch xyz

With warm caches...

Git 1.7.6.4:
real	0m8.232s
user	0m7.842s
sys	0m0.385s

Git 1.7.6.4, with patch below:
real	0m0.394s
user	0m0.069s
sys	0m0.324s

On Tue, Sep 27, 2011 at 11:01 AM, David Barr <davidbarr@google.com> wrote:
> Martin Fick reported:
>  OK, I have found what I believe is another performance
>  regression for large ref counts (~100K).
>
>  When I run git br on my repo which only has one branch, but
>  has ~100K refs under ref/changes (a gerrit repo), it takes
>  normally 3-6mins depending on whether my caches are fresh or
>  not.  After bisecting some older changes, I noticed that
>  this ref seems to be where things start to get slow:
>  v1.5.2-rc0~21^2 (refs.c: add a function to sort a ref list,
>  rather then sorting on add) (Julian Phillips, Apr 17, 2007)
>
> Martin Fick observed that sort_refs_lists() was called almost
> as many times as there were loose refs.
>
> Julian Phillips commented:
>  Back when I made that change, I failed to notice that get_ref_dir
>  was recursive for subdirectories ... sorry ...
>
>  Hopefully this should speed things up. My test repo went from
>  ~17m user time, to ~2.5s.
>  Packing still make things much faster of course.
>
> Martin Fick acked:
>  Excellent!  This works (almost, in my refs.c it is called
>  sort_ref_list, not sort_refs_list).  So, on the non garbage
>  collected repo, git branch now takes ~.5s, and in the
>  garbage collected one it takes only ~.05s!
>
> [db: summarised transcript, rewrote patch to fix callee not callers]
>
> [attn jch: patch applies to maint]
>
> Analyzed-by: Martin Fick <mfick@codeaurora.org>
> Inspired-by: Julian Phillips <julian@quantumfyre.co.uk>
> Acked-by: Martin Fick <mfick@codeaurora.org>
> Signed-off-by: David Barr <davidbarr@google.com>
> ---
>  refs.c |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/refs.c b/refs.c
> index 4c1fd47..e40a09c 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -255,8 +255,8 @@ static struct ref_list *get_packed_refs(const char *submodule)
>        return refs->packed;
>  }
>
> -static struct ref_list *get_ref_dir(const char *submodule, const char *base,
> -                                   struct ref_list *list)
> +static struct ref_list *walk_ref_dir(const char *submodule, const char *base,
> +                                    struct ref_list *list)
>  {
>        DIR *dir;
>        const char *path;
> @@ -299,7 +299,7 @@ static struct ref_list *get_ref_dir(const char *submodule, const char *base,
>                        if (stat(refdir, &st) < 0)
>                                continue;
>                        if (S_ISDIR(st.st_mode)) {
> -                               list = get_ref_dir(submodule, ref, list);
> +                               list = walk_ref_dir(submodule, ref, list);
>                                continue;
>                        }
>                        if (submodule) {
> @@ -319,7 +319,13 @@ static struct ref_list *get_ref_dir(const char *submodule, const char *base,
>                free(ref);
>                closedir(dir);
>        }
> -       return sort_ref_list(list);
> +       return list;
> +}
> +
> +static struct ref_list *get_ref_dir(const char *submodule, const char *base,
> +                                   struct ref_list *list)
> +{
> +       return sort_ref_list(walk_ref_dir(submodule, base, list));
>  }
>
>  struct warn_if_dangling_data {
> --
> 1.7.5.75.g69330
>
>



-- 

David Barr | Software Engineer | davidbarr@google.com | 614-3438-8348

^ permalink raw reply	[relevance 7%]

* Re: [ANNOUNCE] Git 1.7.6.4
  2011-09-23 23:37 14% [ANNOUNCE] Git 1.7.6.4 Junio C Hamano
  2011-09-24  3:33  6% ` BJ Hargrave
@ 2011-09-24 10:35  6% ` Robin H. Johnson
  1 sibling, 0 replies; 21+ results
From: Robin H. Johnson @ 2011-09-24 10:35 UTC (permalink / raw)
  To: Git Mailing List

On Fri, Sep 23, 2011 at 04:37:53PM -0700,  Junio C Hamano wrote:
> The latest maintenance release Git 1.7.6.4 is available but not at the
> usual places.
> 
> The release tarballs are found at:
> 
>     http://code.google.com/p/git-core/downloads/list
> 
> and their SHA-1 checksums are:
> 
> df91e2c32d6097ab1c9d0edc56dd8cecb4e9b686  git-1.7.6.4.tar.gz
> 6abd985e24b6585284cef7fae2e3046ba9201356  git-htmldocs-1.7.6.4.tar.gz
> c6f6d92f4005a7eccaf89e851c45768c18f7e65a  git-manpages-1.7.6.4.tar.gz
Can you please upload the manpages and htmldocs tarballs to
code.google.com downloads? We use them in packaging on Gentoo for users
that want the docs without all of the documentation build chain.

(For 1.7.7.rc* too please).

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

^ permalink raw reply	[relevance 6%]

* Re: [ANNOUNCE] Git 1.7.6.4
  2011-09-24  3:33  6% ` BJ Hargrave
@ 2011-09-24  3:50  6%   ` Junio C Hamano
  0 siblings, 0 replies; 21+ results
From: Junio C Hamano @ 2011-09-24  3:50 UTC (permalink / raw)
  To: BJ Hargrave; +Cc: git, Michael Haggerty

BJ Hargrave <bj@bjhargrave.com> writes:

> The test
>
>  invalid_ref "$(printf 'heads/foo\177')"
>
> was added to t1402-check-ref-format.sh. However sh on my RHEL 4 system
> does not handle the DEL (\177) character well in double quoted strings.
>
> sh-3.00$ echo $(printf 'hello\177') | hexdump -C
> 00000000  68 65 6c 6c 6f 7f 0a                              |hello..|
> 00000007
> sh-3.00$ echo "$(printf 'hello\177')" | hexdump -C
> 00000000  68 65 6c 6c 6f 0a                                 |hello.|
> 00000006
>
> The double quotes cause the DEL (\177) character to be discarded.
>
> Can this test be rewritten to avoid this apparent bug in sh on RHEL 4?

For older distros, I would prefer a workaround patch first tested by
distro packaging people and then upstreamed.

Thanks.

^ permalink raw reply	[relevance 6%]

* Re: [ANNOUNCE] Git 1.7.6.4
  2011-09-23 23:37 14% [ANNOUNCE] Git 1.7.6.4 Junio C Hamano
@ 2011-09-24  3:33  6% ` BJ Hargrave
  2011-09-24  3:50  6%   ` Junio C Hamano
  2011-09-24 10:35  6% ` Robin H. Johnson
  1 sibling, 1 reply; 21+ results
From: BJ Hargrave @ 2011-09-24  3:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Michael Haggerty

On Sep 23, 2011, at 19:37 , Junio C Hamano wrote:
> * "git check-ref-format --print" used to parrot a candidate string that
>   began with a slash (e.g. /refs/heads/master) without stripping it, to make
>   the result a suitably normalized string the caller can append to "$GIT_DIR/".

When building 1.7.6.4 on my RHEL 4 system, it failed t1402-check-ref-format.sh:

 not ok - 19 ref name 'heads/foo' is not valid

I bisected and found that commit f3738c1ce9193a4bf45ba1a3ea67d0cf32da0257 introduced the issue. 

The test

 invalid_ref "$(printf 'heads/foo\177')"

was added to t1402-check-ref-format.sh. However sh on my RHEL 4 system does not handle the DEL (\177) character well in double quoted strings.

sh-3.00$ echo $(printf 'hello\177') | hexdump -C
00000000  68 65 6c 6c 6f 7f 0a                              |hello..|
00000007
sh-3.00$ echo "$(printf 'hello\177')" | hexdump -C
00000000  68 65 6c 6c 6f 0a                                 |hello.|
00000006

The double quotes cause the DEL (\177) character to be discarded.

Can this test be rewritten to avoid this apparent bug in sh on RHEL 4?

-- 

BJ Hargrave

^ permalink raw reply	[relevance 6%]

* [ANNOUNCE] Git 1.7.7.rc3
@ 2011-09-23 23:41  5% Junio C Hamano
  0 siblings, 0 replies; 21+ results
From: Junio C Hamano @ 2011-09-23 23:41 UTC (permalink / raw)
  To: git; +Cc: Linux Kernel

A release candidate Git 1.7.7.rc3 is available for testing but not at the
usual places.

The tarball is found at:

    http://code.google.com/p/git-core/downloads/list

and its SHA-1 checksum is:

c6ba05a833cab49dd66dd1e252306e187effbf2b  git-1.7.7.rc3.tar.gz

Also the following public repositories all have a copy of the v1.7.7-rc3
tag and the master branch that the tag points at:

        url = git://repo.or.cz/alt-git.git
        url = https://code.google.com/p/git-core/
        url = git://git.sourceforge.jp/gitroot/git-core/git.git
        url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
        url = https://github.com/gitster/git

I had to make a quick fix for a recent regression directly on master, and
I would like to cook it for a few days, so the final has to wait til mid
next week.

Until then please help testing to find other regressions.

----------------------------------------------------------------

Changes since v1.7.7-rc2 are as follows:

Allan Caffee (1):
      describe: Refresh the index when run with --dirty

Jay Soffian (1):
      git-mergetool: check return value from read

Jeff King (1):
      t4014: clean up format.thread config after each test

Junio C Hamano (3):
      Git 1.7.6.4
      merge-recursive: Do not look at working tree during a virtual ancestor merge
      Git 1.7.7-rc3

^ permalink raw reply	[relevance 5%]

* [ANNOUNCE] Git 1.7.6.4
@ 2011-09-23 23:37 14% Junio C Hamano
  2011-09-24  3:33  6% ` BJ Hargrave
  2011-09-24 10:35  6% ` Robin H. Johnson
  0 siblings, 2 replies; 21+ results
From: Junio C Hamano @ 2011-09-23 23:37 UTC (permalink / raw)
  To: git; +Cc: Linux Kernel

The latest maintenance release Git 1.7.6.4 is available but not at the
usual places.

The release tarballs are found at:

    http://code.google.com/p/git-core/downloads/list

and their SHA-1 checksums are:

df91e2c32d6097ab1c9d0edc56dd8cecb4e9b686  git-1.7.6.4.tar.gz
6abd985e24b6585284cef7fae2e3046ba9201356  git-htmldocs-1.7.6.4.tar.gz
c6f6d92f4005a7eccaf89e851c45768c18f7e65a  git-manpages-1.7.6.4.tar.gz

Also the following public repositories all have a copy of the v1.7.6.4
tag and the maint branch that the tag points at:

        url = git://repo.or.cz/alt-git.git
        url = https://code.google.com/p/git-core/
        url = git://git.sourceforge.jp/gitroot/git-core/git.git
        url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
        url = https://github.com/gitster/git


Git v1.7.6.4 Release Notes
==========================

Fixes since v1.7.6.3
--------------------

 * The error reporting logic of "git am" when the command is fed a file
   whose mail-storage format is unknown was fixed.

 * "git branch --set-upstream @{-1} foo" did not expand @{-1} correctly.

 * "git check-ref-format --print" used to parrot a candidate string that
   began with a slash (e.g. /refs/heads/master) without stripping it, to make
   the result a suitably normalized string the caller can append to "$GIT_DIR/".

 * "git clone" failed to clone locally from a ".git" file that itself
   is not a directory but is a pointer to one.

 * "git clone" from a local repository that borrows from another
   object store using a relative path in its objects/info/alternates
   file did not adjust the alternates in the resulting repository.

 * "git describe --dirty" did not refresh the index before checking the
   state of the working tree files.

 * "git ls-files ../$path" that is run from a subdirectory reported errors
   incorrectly when there is no such path that matches the given pathspec.

 * "git mergetool" could loop forever prompting when nothing can be read
   from the standard input.

Also contains minor fixes and documentation updates.

^ permalink raw reply	[relevance 14%]

Results 1-21 of 21 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2011-09-23 23:37 14% [ANNOUNCE] Git 1.7.6.4 Junio C Hamano
2011-09-24  3:33  6% ` BJ Hargrave
2011-09-24  3:50  6%   ` Junio C Hamano
2011-09-24 10:35  6% ` Robin H. Johnson
2011-09-23 23:41  5% [ANNOUNCE] Git 1.7.7.rc3 Junio C Hamano
2011-09-26 23:37     Git is not scalable with too many refs/* David Michael Barr
2011-09-27  1:01     ` [PATCH] refs.c: Fix slowness with numerous loose refs David Barr
2011-09-27  2:04  7%   ` David Michael Barr
2011-10-25 15:58  9% pull is not a git command - 1.7.6.4 Eugene Sajine
2011-10-25 16:27  0% ` Matthieu Moy
2011-10-25 16:50  0%   ` Eugene Sajine
2011-10-25 16:45  7% ` Junio C Hamano
2011-10-25 16:52  0%   ` Eugene Sajine
2011-10-25 17:01  0%     ` Matthieu Moy
2011-10-25 18:10  0%       ` Eugene Sajine
2011-11-23 12:09  5% Incremental use of fast-import may cause conflicting notes Henrik Grubbström
2011-11-23 12:10  0% ` Henrik Grubbström
2011-11-23 17:40  6% Infinite loop in cascade_filter_fn() Henrik Grubbström
2011-11-25 14:31  0% ` Carlos Martín Nieto
2011-11-25 15:38  0% ` Carlos Martín Nieto
2012-05-31 11:48  4% git version statistics Jeff King
2014-05-18 21:59     [GUILT v4 00/33] Teach guilt import-commit how to create legal patch names, and more Per Cederqvist
2014-05-18 21:59  4% ` [GUILT v4 14/33] Use "git check-ref-format" to validate patch names Per Cederqvist
2015-01-22 14:18  0%   ` Jeff Sipek

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).