Git development
 help / color / mirror / Atom feed
* Re: [PATCH 4/4] clone: use --progress to force progress reporting
From: Miklos Vajna @ 2009-12-27  1:20 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: git, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <1261761126-5784-5-git-send-email-rctay89@gmail.com>

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

On Sat, Dec 26, 2009 at 01:12:06AM +0800, Tay Ray Chuan <rctay89@gmail.com> wrote:
> -v/--verbose now does not force progress reporting. Make git-clone.txt
> say so.
> 
> This should cover all the bases in 21188b1 (Implement git clone -v),
> which implemented the option to force progress reporting.
> 
> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
> ---
>  Documentation/git-clone.txt |    3 +++
>  builtin-clone.c             |    8 ++++++--
>  t/t5702-clone-options.sh    |    3 ++-
>  3 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
> index e722e6c..f43c8b2 100644
> --- a/Documentation/git-clone.txt
> +++ b/Documentation/git-clone.txt
> @@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
>  
>  --verbose::
>  -v::
> +	Run verbosely.

What about mentioning this "does not force progress reporting" behaviour
in documentation of the "new" -v option?

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

^ permalink raw reply

* [PATCH 2/2] Smart-http: check if repository is OK to export before serving it
From: Tarmigan Casebolt @ 2009-12-26 23:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: spearce, git, rctay89, drizzd, warthog9, Tarmigan Casebolt
In-Reply-To: <1261870153-57572-1-git-send-email-tarmigan+git@gmail.com>

Similar to how git-daemon checks whether a repository is OK to be
exported, smart-http should also check.  This check can be satisfied
in two different ways: the environmental variable GIT_HTTP_EXPORT_ALL
may be set to export all repositories, or the individual repository
may have the file git-daemon-export-ok.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 http-backend.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/http-backend.c b/http-backend.c
index f729488..345c12b 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -648,6 +648,9 @@ int main(int argc, char **argv)
 	setup_path();
 	if (!enter_repo(dir, 0))
 		not_found("Not a git repository: '%s'", dir);
+	if (!getenv("GIT_HTTP_EXPORT_ALL") &&
+	    access("git-daemon-export-ok", F_OK) )
+		not_found("Repository not exported: '%s'", dir);
 
 	git_config(http_config, NULL);
 	cmd->imp(cmd_arg);
-- 
1.6.6.2.g5daf2

^ permalink raw reply related

* [PATCH 1/2] Smart-http: Add tests and documentation for export-ok
From: Tarmigan Casebolt @ 2009-12-26 23:29 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: spearce, git, rctay89, drizzd, warthog9, Tarmigan Casebolt
In-Reply-To: <7vk4w963np.fsf@alter.siamese.dyndns.org>

Add some tests for having smart-http check whether a repository is ok
to export.  Add tests for the GIT_HTTP_EXPORT_ALL environmental
variable and checking the git-daemon-export-ok file, while leaving
existing tests still functional.

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 Documentation/git-http-backend.txt |   10 +++++++++
 t/lib-httpd/apache.conf            |    5 ++++
 t/t5560-http-backend.sh            |   39 ++++++++++++++++++++++++++++++++++-
 3 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..c8fe08a 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -18,6 +18,11 @@ The program supports clients fetching using both the smart HTTP protcol
 and the backwards-compatible dumb HTTP protocol, as well as clients
 pushing using the smart HTTP protocol.
 
+It verifies that the directory has the magic file
+"git-daemon-export-ok", and it will refuse to export any git directory
+that hasn't explicitly been marked for export this way (unless the
+GIT_HTTP_EXPORT_ALL environmental variable is set).
+
 By default, only the `upload-pack` service is enabled, which serves
 'git-fetch-pack' and 'git-ls-remote' clients, which are invoked from
 'git-fetch', 'git-pull', and 'git-clone'.  If the client is authenticated,
@@ -70,6 +75,7 @@ Apache 2.x::
 +
 ----------------------------------------------------------------
 SetEnv GIT_PROJECT_ROOT /var/www/git
+SetEnv GIT_HTTP_EXPORT_ALL
 ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
 ----------------------------------------------------------------
 +
@@ -157,6 +163,10 @@ by the invoking web server, including:
 * QUERY_STRING
 * REQUEST_METHOD
 
+The GIT_HTTP_EXPORT_ALL environmental variable may be passed to
+'git-http-backend' to bypass the check for the "git-daemon-export-ok"
+file in each repository before allowing export of that repository.
+
 The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and
 GIT_COMMITTER_EMAIL to '$\{REMOTE_USER}@http.$\{REMOTE_ADDR\}',
 ensuring that any reflogs created by 'git-receive-pack' contain some
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 0fe3fd0..4961505 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -22,8 +22,13 @@ Alias /dumb/ www/
 
 <Location /smart/>
 	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
+	SetEnv GIT_HTTP_EXPORT_ALL
+</Location>
+<Location /smart_noexport/>
+	SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
 </Location>
 ScriptAlias /smart/ ${GIT_EXEC_PATH}/git-http-backend/
+ScriptAlias /smart_noexport/ ${GIT_EXEC_PATH}/git-http-backend/
 <Directory ${GIT_EXEC_PATH}>
 	Options None
 </Directory>
diff --git a/t/t5560-http-backend.sh b/t/t5560-http-backend.sh
index ed034bc..f763880 100755
--- a/t/t5560-http-backend.sh
+++ b/t/t5560-http-backend.sh
@@ -23,7 +23,7 @@ config() {
 }
 
 GET() {
-	curl --include "$HTTPD_URL/smart/repo.git/$1" >out 2>/dev/null &&
+	curl --include "$HTTPD_URL/$SMART/repo.git/$1" >out 2>/dev/null &&
 	tr '\015' Q <out |
 	sed '
 		s/Q$//
@@ -91,6 +91,20 @@ get_static_files() {
 	GET $IDX_URL "$1"
 }
 
+SMART=smart_noexport
+test_expect_success 'no export by default' '
+	log_div "no git-daemon-export-ok"
+	get_static_files "404 Not Found"
+'
+test_expect_success 'export if git-daemon-export-ok' '
+	log_div "git-daemon-export-ok"
+        (cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
+	 touch git-daemon-export-ok
+	) &&
+        get_static_files "200 OK"
+'
+
+SMART=smart
 test_expect_success 'direct refs/heads/master not found' '
 	log_div "refs/heads/master"
 	GET refs/heads/master "404 Not Found"
@@ -145,7 +159,6 @@ test_expect_success 'http.receivepack false' '
 	GET info/refs?service=git-receive-pack "403 Forbidden" &&
 	POST git-receive-pack 0000 "403 Forbidden"
 '
-
 run_backend() {
 	REQUEST_METHOD=GET \
 	GIT_PROJECT_ROOT="$HTTPD_DOCUMENT_ROOT_PATH" \
@@ -179,6 +192,28 @@ test_expect_success 'http-backend blocks bad PATH_INFO' '
 
 cat >exp <<EOF
 
+###  no git-daemon-export-ok
+###
+GET  /smart_noexport/repo.git/HEAD HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/info/refs HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/objects/info/packs HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/$PACK_URL HTTP/1.1 404 -
+GET  /smart_noexport/repo.git/$IDX_URL HTTP/1.1 404 -
+
+###  git-daemon-export-ok
+###
+GET  /smart_noexport/repo.git/HEAD HTTP/1.1 200
+GET  /smart_noexport/repo.git/info/refs HTTP/1.1 200
+GET  /smart_noexport/repo.git/objects/info/packs HTTP/1.1 200
+GET  /smart_noexport/repo.git/objects/info/alternates HTTP/1.1 200 -
+GET  /smart_noexport/repo.git/objects/info/http-alternates HTTP/1.1 200 -
+GET  /smart_noexport/repo.git/$LOOSE_URL HTTP/1.1 200
+GET  /smart_noexport/repo.git/$PACK_URL HTTP/1.1 200
+GET  /smart_noexport/repo.git/$IDX_URL HTTP/1.1 200
+
 ###  refs/heads/master
 ###
 GET  /smart/repo.git/refs/heads/master HTTP/1.1 404 -
-- 
1.6.6.2.g5daf2

^ permalink raw reply related

* [PATCH] t1200: work around a bug in some implementations of "find"
From: Junio C Hamano @ 2009-12-26 21:53 UTC (permalink / raw)
  To: git

"find path ..." command should exit with zero status only when all path
operands were traversed successfully.  When a non-existent path is given,
however, some implementations of "find" (e.g. OpenBSD 4.6) exit with zero
status and break the last test in t1200.

Rewrite the test to check that there is no regular files in the objects
fan-out directories to work around this bug; it is closer to what we are
testing anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1200-tutorial.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index 238c2f1..ab55eda 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -259,7 +259,7 @@ test_expect_success 'git repack' 'git repack'
 test_expect_success 'git prune-packed' 'git prune-packed'
 test_expect_success '-> only packed objects' '
 	git prune && # Remove conflict marked blobs
-	! find .git/objects/[0-9a-f][0-9a-f] -type f
+	test $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0
 '
 
 test_done

^ permalink raw reply related

* [PATCH] t4019 "grep" portability fix
From: Junio C Hamano @ 2009-12-26 21:53 UTC (permalink / raw)
  To: git

Input to "grep" is supposed to be "text", but we deliberately feed output
from "git diff --color" to sift it into two sets of lines (ones with
errors, the other without).  Some implementations of "grep" only report
matches with the exit status, without showing the matched lines in their
output (e.g. OpenBSD 4.6, which says "Binary file .. matches").

Fortunately, "grep -a" is often a way to force the command to treat its
input as text.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t4019-diff-wserror.sh |   56 +++++++++++++++++++++++-----------------------
 1 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/t/t4019-diff-wserror.sh b/t/t4019-diff-wserror.sh
index 3a3663f..f6d1f1e 100755
--- a/t/t4019-diff-wserror.sh
+++ b/t/t4019-diff-wserror.sh
@@ -20,11 +20,27 @@ test_expect_success setup '
 
 blue_grep='7;34m' ;# ESC [ 7 ; 3 4 m
 
+printf "\033[%s" "$blue_grep" >check-grep
+if (grep "$blue_grep" <check-grep | grep "$blue_grep") >/dev/null 2>&1
+then
+	grep_a=grep
+elif (grep -a "$blue_grep" <check-grep | grep -a "$blue_grep") >/dev/null 2>&1
+then
+	grep_a='grep -a'
+else
+	grep_a=grep ;# expected to fail...
+fi
+rm -f check-grep
+
+prepare_output () {
+	git diff --color >output
+	$grep_a "$blue_grep" output >error
+	$grep_a -v "$blue_grep" output >normal
+}
+
 test_expect_success default '
 
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT error >/dev/null &&
@@ -37,9 +53,7 @@ test_expect_success default '
 test_expect_success 'without -trail' '
 
 	git config core.whitespace -trail
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT error >/dev/null &&
@@ -53,9 +67,7 @@ test_expect_success 'without -trail (attribute)' '
 
 	git config --unset core.whitespace
 	echo "F whitespace=-trail" >.gitattributes
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT error >/dev/null &&
@@ -69,9 +81,7 @@ test_expect_success 'without -space' '
 
 	rm -f .gitattributes
 	git config core.whitespace -space
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT normal >/dev/null &&
@@ -85,9 +95,7 @@ test_expect_success 'without -space (attribute)' '
 
 	git config --unset core.whitespace
 	echo "F whitespace=-space" >.gitattributes
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT normal >/dev/null &&
@@ -101,9 +109,7 @@ test_expect_success 'with indent-non-tab only' '
 
 	rm -f .gitattributes
 	git config core.whitespace indent,-trailing,-space
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight error >/dev/null &&
 	grep HT normal >/dev/null &&
@@ -117,9 +123,7 @@ test_expect_success 'with indent-non-tab only (attribute)' '
 
 	git config --unset core.whitespace
 	echo "F whitespace=indent,-trailing,-space" >.gitattributes
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight error >/dev/null &&
 	grep HT normal >/dev/null &&
@@ -133,9 +137,7 @@ test_expect_success 'with cr-at-eol' '
 
 	rm -f .gitattributes
 	git config core.whitespace cr-at-eol
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT error >/dev/null &&
@@ -149,9 +151,7 @@ test_expect_success 'with cr-at-eol (attribute)' '
 
 	git config --unset core.whitespace
 	echo "F whitespace=trailing,cr-at-eol" >.gitattributes
-	git diff --color >output
-	grep "$blue_grep" output >error
-	grep -v "$blue_grep" output >normal
+	prepare_output
 
 	grep Eight normal >/dev/null &&
 	grep HT error >/dev/null &&
@@ -195,7 +195,7 @@ test_expect_success 'color new trailing blank lines' '
 	git add x &&
 	{ echo a; echo; echo; echo; echo c; echo; echo; echo; echo; } >x &&
 	git diff --color x >output &&
-	cnt=$(grep "${blue_grep}" output | wc -l) &&
+	cnt=$($grep_a "${blue_grep}" output | wc -l) &&
 	test $cnt = 2
 '
 

^ permalink raw reply related

* Re: Does smart-http need git-daemon-export-ok?
From: Junio C Hamano @ 2009-12-26 17:33 UTC (permalink / raw)
  To: Tarmigan
  Cc: Shawn O. Pearce, Git Mailing List, Tay Ray Chuan,
	Clemens Buchacher, J.H.
In-Reply-To: <905315640912260821k2fb149b3je69dbea5463afaa3@mail.gmail.com>

Tarmigan <tarmigan+git@gmail.com> writes:

> Should the git-http-backend check something like git-daemon-export-ok
> before serving a repository?

I'd agree that it would make sense to have a way to mark individual
repository for (or not for) export.

In "native" case, the chain of events are: client talks to the daemon, the
daemon checks and decides to (or not to) export, and it runs upload-pack.

In "smart http" case, http-backend is one half of what corresponds to the
daemon (the other half being your http server configuration), and it is
more flexible and git specific half, so I'd say it would make sense to
implement the check that honors the same git-daemon-export-ok flag file in
it.

^ permalink raw reply

* [PATCH] Smart-http documentation: add example of how to execute from userdir
From: Tarmigan Casebolt @ 2009-12-26 17:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Tarmigan Casebolt, Shawn O. Pearce

Smart-http may be an attactive and easy way for people to setup git
hosting on shared servers whose primary web server configuration they
do not control.  To facilite this, provide an example of how it may be
done.

cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 Documentation/git-http-backend.txt |   40 ++++++++++++++++++++++++++++++++++-
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt
index 67aec06..0cca5ba 100644
--- a/Documentation/git-http-backend.txt
+++ b/Documentation/git-http-backend.txt
@@ -60,8 +60,8 @@ automatically by the web server.
 
 EXAMPLES
 --------
-All of the following examples map 'http://$hostname/git/foo/bar.git'
-to '/var/www/git/foo/bar.git'.
+Unless otherwise noted, the following examples map
+'http://$hostname/git/foo/bar.git' to '/var/www/git/foo/bar.git'.
 
 Apache 2.x::
 	Ensure mod_cgi, mod_alias, and mod_env are enabled, set
@@ -144,6 +144,42 @@ ScriptAliasMatch \
 ScriptAlias /git/ /var/www/cgi-bin/gitweb.cgi/
 ----------------------------------------------------------------
 
+In the following example, a repository at
+'/home/$username/devel/foo/bar.git' will be accessible at
+'http://$hostname/\~$username/cgi-bin/git/foo/bar.git'
+
+From UserDir on Apache 2.x::
+       One way to configure 'git-http-backend' to execute and serve
+       from a user directory (for example, on a shared hosting
+       provider), is to have a symbolic link that points from the cgi
+       directory to the 'git-http-backend' executable in libexec.  The
+       advantage of the symblic link is that any updates to the
+       installed version of 'git-http-backend' also update the version
+       that is run in the userdir.  Depending on the configuration of
+       the server, the symbolic link may be able to point to a global
+       installation of git.  If, for security reasons, the server is
+       configured to follow symbolic links only if the owner matches,
+       an installation of git into the user directory may be required.
+       In that case, install git as that user into \~/bin, \~/libexec
+       etc.  Then create a symlink named 'git' in the cgi-bin
+       directory that points to
+       \~/libexec/git-core/git-http-backend. Put the following in
+       \~/public_html/cgi-bin/.htaccess:
++
+----------------------------------------------------------------
+SetHandler cgi-script
+Options +SymLinksIfOwnerMatch
+SetEnv GIT_PROJECT_ROOT /home/$username/devel
+----------------------------------------------------------------
++
+Also add any needed authentication to the .htaccess file as discussed
+in earlier examples.
++
+If the web server does not follow any symbolic links, the
+'git-http-backend' executable may be copied into the cgi-bin directory
+and renamed to 'git' to acheive the same effect, but it will also need
+to be manually updated whenever a new version of 'git-http-backend' is
+installed.
 
 ENVIRONMENT
 -----------
-- 
1.6.6

^ permalink raw reply related

* [PATCH] Add git-http-backend to command-list.
From: Tarmigan Casebolt @ 2009-12-26 17:01 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Tarmigan Casebolt

Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com>
---
 command-list.txt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/command-list.txt b/command-list.txt
index cc5d48b..95bf18c 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -49,6 +49,7 @@ git-grep                                mainporcelain common
 git-gui                                 mainporcelain
 git-hash-object                         plumbingmanipulators
 git-help				ancillaryinterrogators
+git-http-backend                        synchingrepositories
 git-http-fetch                          synchelpers
 git-http-push                           synchelpers
 git-imap-send                           foreignscminterface
-- 
1.6.6

^ permalink raw reply related

* Does smart-http need git-daemon-export-ok?
From: Tarmigan @ 2009-12-26 16:21 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailing List, Tay Ray Chuan, Clemens Buchacher, J.H.

Hi all,

Should the git-http-backend check something like git-daemon-export-ok
before serving a repository?  It would have been better to discuss
this a month or two ago, but it's probably not too late since
smart-http is still so new in released versions.

I think it's very similar to git-daemon which requires that to be set,
and I think the same arguments could be made for the same kind of
check.  There are already parallels for the upload-pack and
receive-pack services between the two.

Just as git-daemon may be invoked with --export-all, for
git-http-backend we could have an environmental variable to export all
repositories.

Thoughts?

Thanks,
Tarmigan

^ permalink raw reply

* Re: Set the repository as it was on an earlier commit
From: Matthieu Moy @ 2009-12-26 14:28 UTC (permalink / raw)
  To: Santi Béjar; +Cc: Sergio Belkin, git
In-Reply-To: <adf1fd3d0912251536kbf25272ob0ab8ee90e53861d@mail.gmail.com>

Santi Béjar <santi@agolina.net> writes:

> I don't know if it is possible with porcelain commands, but with
> plumbing you can:
>
> # begin with a clean working dir
> git read-tree B
> git commit
> git reset --hard

I guess

(at the root of the repo)

git checkout B -- .
# git status if you want to check.
git commit

does this. The "-- ." part of "git checkout" asks Git to checkout the
files, but the path limiter prevents it from updating HEAD, so the
HEAD still points to the tip of the branch.

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

^ permalink raw reply

* [PATCH/RFC] FreeBSD iconv function signature is "old"
From: Junio C Hamano @ 2009-12-26  9:09 UTC (permalink / raw)
  To: git
In-Reply-To: <7v7hxysie9.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> I noticed that my build on FreeBSD-7.2-RELEASE-i386 fails without
> OLD_ICONV=YesPlease.
>
> Is it just me and my installation (i.e. I might have failed to install
> saner iconv from the port that everybody uses), or is everybody who runs
> on FreeBSD using this option himself because our Makefile doesn't do that
> automatically for them?
>
> Just in case it is the latter, here is a proposed patch.

By the way, FreeBSD-8.0-RELEASE-i386 has the same issue.  I'll queue it to
'maint' unless anybody objects...

>  Makefile |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index bde27ed..9a25c08 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -777,6 +777,7 @@ ifeq ($(uname_O),Cygwin)
>  endif
>  ifeq ($(uname_S),FreeBSD)
>  	NEEDS_LIBICONV = YesPlease
> +	OLD_ICONV = YesPlease
>  	NO_MEMMEM = YesPlease
>  	BASIC_CFLAGS += -I/usr/local/include
>  	BASIC_LDFLAGS += -L/usr/local/lib

^ permalink raw reply

* Re: [PATCH 0/4] clone: use --progress to mean -v
From: Johannes Schindelin @ 2009-12-26  8:53 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: git, Miklos Vajna, Nicolas Pitre, Junio C Hamano
In-Reply-To: <1261761126-5784-1-git-send-email-rctay89@gmail.com>

Hi,

On Sat, 26 Dec 2009, Tay Ray Chuan wrote:

> This series makes git-clone follow the "argument convention" of 
> git-pack-objects, where the option --progress is used to force reporting 
> of reporting. This was previously done with -v/--verbose.

No objections from my side, although you might want to advertise more that 
this is a change in behavior.  (Meaning in the release notes)

> PS. If someone can enlighten me on the proper noun for the git
>     executable (I said "main git"), I would be very thankful.

I call it the "Git wrapper", although less polite words exist, too.

Ciao,
Dscho

^ permalink raw reply

* Re: Branch shuffling after 1.6.6 release plans
From: Jeff King @ 2009-12-26  8:01 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Junio C Hamano, git
In-Reply-To: <200912251230.48243.trast@student.ethz.ch>

On Fri, Dec 25, 2009 at 12:30:34PM +0100, Thomas Rast wrote:

> >      * tr/reset-checkout-patch (2009-11-19) 1 commit
> >       - {checkout,reset} -p: make patch direction configurable
> > 
> >      I do not particularly like a configuration like this that changes the
> >      behaviour of a command in a drastic way---it will make helping others
> >      much harder.
> 
> I think it's not quite as drastic as you make it sound ;-)
> 
> But I don't need this feature, and Peff mentioned something about
> being happy except for the patch editing mode.  Unfortunately the
> above pretty much hits the limits of add--interactive's flexibility,
> so an interactive direction toggling feature would need some rewiring.

Let's drop it for now. I'm reasonably happy, and I don't want to waste
your time trying to do something more invasive. And I haven't seen any
evidence that anybody else is dissatisfied with what's in master.

-Peff

^ permalink raw reply

* Re: Set the repository as it was on an earlier commit
From: Santi Béjar @ 2009-12-25 23:36 UTC (permalink / raw)
  To: Sergio Belkin; +Cc: git
In-Reply-To: <8c6f7f450912251509i67da4665t78be0bb79f2c40d6@mail.gmail.com>

On Sat, Dec 26, 2009 at 12:09 AM, Sergio Belkin <sebelk@gmail.com> wrote:
> Hi,
>
> Firstly merry Christmas everyone.
>
> I am somewhat new to git, and I've found great, but still I have some
> doubts about it, let's say I have the following repo with:
>
> A---B---C---D
>
> Being A the first commit,  B the second one an D the last one.
>
> How I do to go back to let's say... B commit status, I mean somewhat as follows:
>
> A---B---C---D---B'
>
> B' would be the same as B. I am not asking to do something so:
>
> A---B---C---D to A---B losing C and D commits,
>
> I'd like to keep on history C and D commits, can git to do that?

I don't know if it is possible with porcelain commands, but with
plumbing you can:

# begin with a clean working dir
git read-tree B
git commit
git reset --hard

HTH,
Santi

^ permalink raw reply

* Re: Set the repository as it was on an earlier commit
From: Steven Noonan @ 2009-12-25 23:24 UTC (permalink / raw)
  To: Sergio Belkin; +Cc: git
In-Reply-To: <8c6f7f450912251509i67da4665t78be0bb79f2c40d6@mail.gmail.com>

On Fri, Dec 25, 2009 at 3:09 PM, Sergio Belkin <sebelk@gmail.com> wrote:
> Hi,
>
> Firstly merry Christmas everyone.
>
> I am somewhat new to git, and I've found great, but still I have some
> doubts about it, let's say I have the following repo with:
>
> A---B---C---D
>
> Being A the first commit,  B the second one an D the last one.
>
> How I do to go back to let's say... B commit status, I mean somewhat as follows:
>
> A---B---C---D---B'
>
> B' would be the same as B. I am not asking to do something so:
>
> A---B---C---D to A---B losing C and D commits,
>
> I'd like to keep on history C and D commits, can git to do that?
>
> Thanks in advance!
>

git revert D
git revert C

Maybe? It would create two revert commits, but it would get you back
to the state of B.

- Steven

^ permalink raw reply

* Set the repository as it was on an earlier commit
From: Sergio Belkin @ 2009-12-25 23:09 UTC (permalink / raw)
  To: git

Hi,

Firstly merry Christmas everyone.

I am somewhat new to git, and I've found great, but still I have some
doubts about it, let's say I have the following repo with:

A---B---C---D

Being A the first commit,  B the second one an D the last one.

How I do to go back to let's say... B commit status, I mean somewhat as follows:

A---B---C---D---B'

B' would be the same as B. I am not asking to do something so:

A---B---C---D to A---B losing C and D commits,

I'd like to keep on history C and D commits, can git to do that?

Thanks in advance!

-- 
--
Open Kairos http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -

^ permalink raw reply

* Re: [RFC PATCH 1/2] Report exec errors from run-command
From: Ilari Liusvaara @ 2009-12-25 17:15 UTC (permalink / raw)
  To: Johannes Sixt; +Cc: git
In-Reply-To: <200912251539.35201.j6t@kdbg.org>

On Fri, Dec 25, 2009 at 03:39:34PM +0100, Johannes Sixt wrote:
> 
> The only really *important* errno of a failed exec is ENOENT. For this case, 
> wouldn't it be easier to do the PATH lookup manually in the parent (before 
> the fork()), and use execv() in the forked child rather than execvp()?

In fact there is API for getting all valid commands on $PATH for given command
prefix. That would take care of ENOENT and most of EACCESS.

But OTOH, its nice to be able to report any error.

-Ilari

^ permalink raw reply

* [PATCH 4/4] clone: use --progress to force progress reporting
From: Tay Ray Chuan @ 2009-12-25 17:12 UTC (permalink / raw)
  To: git; +Cc: Miklos Vajna, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <1261761126-5784-4-git-send-email-rctay89@gmail.com>

Follow the argument convention of git-pack-objects, such that a
separate option (--preogress) is used to force progress reporting
instead of -v/--verbose.

-v/--verbose now does not force progress reporting. Make git-clone.txt
say so.

This should cover all the bases in 21188b1 (Implement git clone -v),
which implemented the option to force progress reporting.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 Documentation/git-clone.txt |    3 +++
 builtin-clone.c             |    8 ++++++--
 t/t5702-clone-options.sh    |    3 ++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index e722e6c..f43c8b2 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -102,6 +102,9 @@ objects from the source repository into a pack in the cloned repository.
 
 --verbose::
 -v::
+	Run verbosely.
+
+--progress::
 	Progress status is reported on the standard error stream
 	by default when it is attached to a terminal, unless -q
 	is specified. This flag forces progress status even if the
diff --git a/builtin-clone.c b/builtin-clone.c
index 463fbe4..58bacbd 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -44,10 +44,13 @@ static char *option_origin = NULL;
 static char *option_branch = NULL;
 static char *option_upload_pack = "git-upload-pack";
 static int option_verbose;
+static int option_progress;
 
 static struct option builtin_clone_options[] = {
 	OPT__QUIET(&option_quiet),
 	OPT__VERBOSE(&option_verbose),
+	OPT_BOOLEAN(0, "progress", &option_progress,
+			"force progress reporting"),
 	OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
 		    "don't create a checkout"),
 	OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
@@ -525,10 +528,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (option_quiet)
 			transport->verbose = -1;
-		else if (option_verbose) {
+		else if (option_verbose)
 			transport->verbose = 1;
+
+		if (option_progress)
 			transport->progress = 1;
-		}
 
 		if (option_upload_pack)
 			transport_set_option(transport, TRANS_OPT_UPLOADPACK,
diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh
index 27825f5..02cb024 100755
--- a/t/t5702-clone-options.sh
+++ b/t/t5702-clone-options.sh
@@ -27,7 +27,8 @@ test_expect_success 'redirected clone' '
 '
 test_expect_success 'redirected clone -v' '
 
-	git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err &&
+	git clone --progress "file://$(pwd)/parent" clone-redirected-progress \
+		>out 2>err &&
 	test -s err
 
 '
-- 
1.6.6.278.g3f5f

^ permalink raw reply related

* [PATCH 3/4] clone: set transport->verbose when -v/--verbose is used
From: Tay Ray Chuan @ 2009-12-25 17:12 UTC (permalink / raw)
  To: git; +Cc: Miklos Vajna, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <1261761126-5784-3-git-send-email-rctay89@gmail.com>

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin-clone.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/builtin-clone.c b/builtin-clone.c
index 5df8b0f..463fbe4 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -525,8 +525,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		if (option_quiet)
 			transport->verbose = -1;
-		else if (option_verbose)
+		else if (option_verbose) {
+			transport->verbose = 1;
 			transport->progress = 1;
+		}
 
 		if (option_upload_pack)
 			transport_set_option(transport, TRANS_OPT_UPLOADPACK,
-- 
1.6.6.278.g3f5f

^ permalink raw reply related

* [PATCH 2/4] git-clone.txt: reword description of progress behaviour
From: Tay Ray Chuan @ 2009-12-25 17:12 UTC (permalink / raw)
  To: git; +Cc: Miklos Vajna, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <1261761126-5784-2-git-send-email-rctay89@gmail.com>

Mention progress reporting behaviour in the descriptions for -q/
--quiet and -v/--verbose options, in the style of git-pack-objects.txt.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 Documentation/git-clone.txt |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index f298fdd..e722e6c 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -96,13 +96,16 @@ objects from the source repository into a pack in the cloned repository.
 
 --quiet::
 -q::
-	Operate quietly.  This flag is also passed to the `rsync'
+	Operate quietly.  Progress is not reported to the standard
+	error stream. This flag is also passed to the `rsync'
 	command when given.
 
 --verbose::
 -v::
-	Display the progress bar, even in case the standard error is not
-	a terminal.
+	Progress status is reported on the standard error stream
+	by default when it is attached to a terminal, unless -q
+	is specified. This flag forces progress status even if the
+	standard error stream is not directed to a terminal.
 
 --no-checkout::
 -n::
-- 
1.6.6.278.g3f5f

^ permalink raw reply related

* [PATCH 1/4] check stderr with isatty() instead of stdout when deciding to show progress
From: Tay Ray Chuan @ 2009-12-25 17:12 UTC (permalink / raw)
  To: git; +Cc: Miklos Vajna, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <1261761126-5784-1-git-send-email-rctay89@gmail.com>

Make transport code (viz. transport.c::fetch_refs_via_pack() and
transport-helper.c::standard_options()) that decides to show progress
check if stderr is a terminal, instead of stdout. After all, progress
reports (via the API in progress.[ch]) are sent to stderr.

Update the documentation for git-clone to say "standard error" as well.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 Documentation/git-clone.txt |    2 +-
 transport-helper.c          |    2 +-
 transport.c                 |    2 +-
 transport.h                 |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index 7ccd742..f298fdd 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -101,7 +101,7 @@ objects from the source repository into a pack in the cloned repository.
 
 --verbose::
 -v::
-	Display the progress bar, even in case the standard output is not
+	Display the progress bar, even in case the standard error is not
 	a terminal.
 
 --no-checkout::
diff --git a/transport-helper.c b/transport-helper.c
index 11f3d7e..b886985 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -169,7 +169,7 @@ static void standard_options(struct transport *t)
 	char buf[16];
 	int n;
 	int v = t->verbose;
-	int no_progress = v < 0 || (!t->progress && !isatty(1));
+	int no_progress = v < 0 || (!t->progress && !isatty(2));
 
 	set_helper_option(t, "progress", !no_progress ? "true" : "false");
 
diff --git a/transport.c b/transport.c
index 3eea836..24c7f1d 100644
--- a/transport.c
+++ b/transport.c
@@ -476,7 +476,7 @@ static int fetch_refs_via_pack(struct transport *transport,
 	args.include_tag = data->followtags;
 	args.verbose = (transport->verbose > 0);
 	args.quiet = (transport->verbose < 0);
-	args.no_progress = args.quiet || (!transport->progress && !isatty(1));
+	args.no_progress = args.quiet || (!transport->progress && !isatty(2));
 	args.depth = data->depth;
 
 	for (i = 0; i < nr_heads; i++)
diff --git a/transport.h b/transport.h
index 9e74406..68fda6a 100644
--- a/transport.h
+++ b/transport.h
@@ -63,7 +63,7 @@ struct transport {
 	int (*disconnect)(struct transport *connection);
 	char *pack_lockfile;
 	signed verbose : 3;
-	/* Force progress even if the output is not a tty */
+	/* Force progress even if stderr is not a tty */
 	unsigned progress : 1;
 };
 
-- 
1.6.6.278.g3f5f

^ permalink raw reply related

* [PATCH 0/4] clone: use --progress to mean -v
From: Tay Ray Chuan @ 2009-12-25 17:12 UTC (permalink / raw)
  To: git; +Cc: Miklos Vajna, Nicolas Pitre, Johannes Schindelin, Junio C Hamano
In-Reply-To: <18831.46833.862.196815@hungover.brentg.com>

This series makes git-clone follow the "argument convention" of
git-pack-objects, where the option --progress is used to force
reporting of reporting. This was previously done with -v/--verbose.

This in effect ensures a single consistent convention regarding
progress reporting for git commands. Having two conventions may
potentially confuse users.

On a related note, Brent wrote a patch a while back [1]. This series is
not as ambitious his and does not deal with the main git options. In
fact, only the last patch effects the titular change. If a consensus is
reached on this though, I don't rule out a separate patch/series to
set the convention at the main git level.

PS. If someone can enlighten me on the proper noun for the git
    executable (I said "main git"), I would be very thankful.

PPS. Merry Christmas and happy holidays. :)

Tay Ray Chuan (4):
  check stderr with isatty() instead of stdout when deciding to show
    progress
  git-clone.txt: reword description of progress behaviour
  clone: set transport->verbose when -v/--verbose is used
  clone: use --progress to force progress reporting

 Documentation/git-clone.txt |   12 +++++++++---
 builtin-clone.c             |    6 ++++++
 t/t5702-clone-options.sh    |    3 ++-
 transport-helper.c          |    2 +-
 transport.c                 |    2 +-
 transport.h                 |    2 +-
 6 files changed, 20 insertions(+), 7 deletions(-)

Footnotes:
[1] http://marc.info/?l=git&m=123415527432713

--
Cheers,
Ray Chuan

^ permalink raw reply

* Re: [RFC PATCH 1/2] Report exec errors from run-command
From: Johannes Sixt @ 2009-12-25 14:39 UTC (permalink / raw)
  To: Ilari Liusvaara; +Cc: git
In-Reply-To: <1261676971-3285-2-git-send-email-ilari.liusvaara@elisanet.fi>

On Donnerstag, 24. Dezember 2009, Ilari Liusvaara wrote:
> Previously run-command was unable to report errors happening in exec
> call. Change it to pass errno from failed exec to errno value at
> return.
>
> The errno value passing can be done by opening close-on-exec pipe and
> piping the error code through in case of failure. In case of success,
> close-on-exec closes the pipe on successful exec and parent process
> gets end of file on read.

The only really *important* errno of a failed exec is ENOENT. For this case, 
wouldn't it be easier to do the PATH lookup manually in the parent (before 
the fork()), and use execv() in the forked child rather than execvp()?

There is already a path lookup function in compat/mingw.c; it could certainly 
need some improvement, but it is a starter.

That said, we don't need the stunt that you implemented on WIN32, because by 
the time mingw_spawnvpe() returns, we have a running child process.

-- Hannes

^ permalink raw reply

* Re: You have local changes; cannot switch branches error question
From: Matthieu Moy @ 2009-12-25 14:32 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Eugene Sajine, git
In-Reply-To: <7vhbrghrsn.fsf@alter.siamese.dyndns.org>

Junio C Hamano <gitster@pobox.com> writes:

> There are two ways to deal with this situation, one safely, and another
> quickly.

And a third one : commit, and then rebase onto the other branch. It's
safe, and nice when your local changes are ready to commit (then, you
can write the commit message before bothering about potential merge
conflicts).

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

^ permalink raw reply

* [PATCH] user-manual: use standarized quoting
From: Felipe Contreras @ 2009-12-25 13:05 UTC (permalink / raw)
  To: git; +Cc: Felipe Contreras

Hi,

This is a big patch that was sent before, but now I'm explaining my rationale
for the quoting style I used. I noticed a few deviations on my own rules, so I
fixed them.

What do you think?

Felipe Contreras (1):
  user-manual: general quoting improvements

 Documentation/user-manual.txt |  884 ++++++++++++++++++++--------------------
 1 files changed, 442 insertions(+), 442 deletions(-)

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox