Git development
 help / color / mirror / Atom feed
* "Nested quantifiers" error in gitweb with "++" in the filename
From: Jehan Bing @ 2011-12-22 20:37 UTC (permalink / raw)
  To: git

Hi,

I'm getting an error when trying to look at a blob when the filename has 
"++" in it:

http://.../blob/13ec1624fefc23d20d0407aac3337b35844a2ceb:/foo-++.txt

And I get the following error page:
	gitprojects /


	500 - Internal Server Error
	Nested quantifiers in regex; marked by <-- HERE in 
m//test.git/blob/13ec1624fefc23d20d0407aac3337b35844a2ceb:/foo-++ <-- 
HERE .txt$/ at (eval 10) line 7.
	OPML TXT


The Apache log show the same thing:
  gitweb.cgi: Nested quantifiers in regex; marked by <-- HERE in 
m//test.git/blob/13ec1624fefc23d20d0407aac3337b35844a2ceb:/foo-++ <-- 
HERE .txt$/ at (eval 10) line 7.


It works fine if the filename has a single '+' sign (tried "foo-+.txt").
There is a same error when browsing a tree and clicking a directory with 
the "++"

We notice the error when looking at the Qt source code. They have a 
bunch of "*g++*" files and directories.

We use git-1.7.6 but updating to gitweb.cgi from 1.7.8.1 didn't fix it.


Regards,
	Jehan

^ permalink raw reply

* What's cooking in git.git (Dec 2011, #08; Thu, 22)
From: Junio C Hamano @ 2011-12-22 20:59 UTC (permalink / raw)
  To: git

Here are the topics that have been cooking.  Commits prefixed with '-' are
only in 'pu' (proposed updates) while commits prefixed with '+' are in
'next'.

The tip of 'master' is now feature complete for 1.7.9 so I could tag it as
the -rc0, but I'll let it simmer for several days to give people chance to
test over the holidays.

Here are the repositories that have my integration branches:

With maint, master, next, pu, todo:

        git://git.kernel.org/pub/scm/git/git.git
        git://repo.or.cz/alt-git.git
        https://code.google.com/p/git-core/
        https://github.com/git/git

With only maint and master:

        git://git.sourceforge.jp/gitroot/git-core/git.git
        git://git-core.git.sourceforge.net/gitroot/git-core/git-core

With all the topics and integration branches:

        https://github.com/gitster/git

The preformatted documentation in HTML and man format are found in:

        git://git.kernel.org/pub/scm/git/git-{htmldocs,manpages}.git/
        git://repo.or.cz/git-{htmldocs,manpages}.git/
        https://code.google.com/p/git-{htmldocs,manpages}.git/
        https://github.com/gitster/git-{htmldocs,manpages}.git/

--------------------------------------------------
[New Topics]

* tr/doc-sh-setup (2011-12-20) 1 commit
  (merged to 'next' on 2011-12-21 at bd73695)
 + git-sh-setup: make require_clean_work_tree part of the interface

* ab/sun-studio-portability (2011-12-21) 3 commits
  (merged to 'next' on 2011-12-21 at 0cc5a63)
 + Appease Sun Studio by renaming "tmpfile"
 + Fix a bitwise negation assignment issue spotted by Sun Studio
 + Fix an enum assignment issue spotted by Sun Studio

* tr/bash-read-unescaped (2011-12-21) 1 commit
  (merged to 'next' on 2011-12-21 at de865c1)
 + bash completion: use read -r everywhere

* jc/advise-i18n (2011-12-22) 1 commit
 - i18n of multi-line advice messages

Allow localization of advice messages that tend to be longer and
multi-line formatted. For now this is deliberately limited to advise()
interface and not vreportf() in general as touching the latter has
interactions with error() that has plumbing callers whose prefix "error: "
should never be translated.

--------------------------------------------------
[Graduated to "master"]

* cn/maint-lf-to-crlf-filter (2011-12-16) 1 commit
  (merged to 'next' on 2011-12-20 at 83d6f7c)
 + lf_to_crlf_filter(): tell the caller we added "\n" when draining
 (this branch is used by jc/maint-lf-to-crlf-keep-crlf.)

A recent fix to the codepath was not quite correct.

* ef/setenv-putenv (2011-12-14) 2 commits
  (merged to 'next' on 2011-12-20 at 4845020)
 + compat/setenv.c: error if name contains '='
 + compat/setenv.c: update errno when erroring out
 (this branch is used by ef/x-setenv-putenv.)

* jc/advice-doc (2011-12-18) 1 commit
  (merged to 'next' on 2011-12-19 at 0b410e5)
 + advice: Document that they all default to true
 (this branch is used by jc/advise-push-default.)

* jc/maint-lf-to-crlf-keep-crlf (2011-12-18) 1 commit
  (merged to 'next' on 2011-12-20 at eee6eb3)
 + lf_to_crlf_filter(): resurrect CRLF->CRLF hack

The lf-to-crlf filter in the streaming checkout codepath forgot that we
try not to convert LF to CRLF if the repository data already has CRLF.

* jc/request-pull-show-head-4 (2011-12-19) 2 commits
  (merged to 'next' on 2011-12-19 at 771939b)
 + request-pull: do not emit "tag" before the tagname
  (merged to 'next' on 2011-12-16 at bea51ac)
 + request-pull: update the "pull" command generation logic

* jk/doc-fsck (2011-12-16) 1 commit
  (merged to 'next' on 2011-12-20 at 70df8a4)
 + docs: brush up obsolete bits of git-fsck manpage

* jk/follow-rename-score (2011-12-16) 1 commit
  (merged to 'next' on 2011-12-20 at 74db2a9)
 + use custom rename score during --follow

* jk/git-prompt (2011-12-12) 10 commits
  (merged to 'next' on 2011-12-20 at 24aff90)
 + contrib: add credential helper for OS X Keychain
 + Makefile: OS X has /dev/tty
 + Makefile: linux has /dev/tty
 + credential: use git_prompt instead of git_getpass
 + prompt: use git_terminal_prompt
 + add generic terminal prompt function
 + refactor git_getpass into generic prompt function
 + move git_getpass to its own source file
 + imap-send: don't check return value of git_getpass
 + imap-send: avoid buffer overflow

* jk/http-push-to-empty (2011-12-19) 1 commit
  (merged to 'next' on 2011-12-19 at 845e2a1)
 + remote-curl: don't pass back fake refs

* jk/maint-do-not-feed-stdin-to-tests (2011-12-15) 1 commit
  (merged to 'next' on 2011-12-20 at 43e83c5)
 + test-lib: redirect stdin of tests

* jk/maint-push-v-is-verbose (2011-12-17) 1 commit
  (merged to 'next' on 2011-12-20 at b79f101)
 + make "git push -v" actually verbose

* jk/maint-strbuf-missing-init (2011-12-18) 2 commits
  (merged to 'next' on 2011-12-20 at 72fa8ae)
 + Update jk/maint-strbuf-missing-init to builtin/ rename
 + commit, merge: initialize static strbuf

* jk/pretty-reglog-ent (2011-12-16) 1 commit
  (merged to 'next' on 2011-12-20 at 949b010)
 + pretty: give placeholders to reflog identity

* jn/test-cleanup-7006 (2011-12-14) 1 commit
  (merged to 'next' on 2011-12-20 at 952f48f)
 + test: errors preparing for a test are not special

* mh/ref-api (2011-12-12) 16 commits
  (merged to 'next' on 2011-12-15 at d65a830)
 + add_ref(): take a (struct ref_entry *) parameter
 + create_ref_entry(): extract function from add_ref()
 + repack_without_ref(): remove temporary
 + resolve_gitlink_ref_recursive(): change to work with struct ref_cache
 + Pass a (ref_cache *) to the resolve_gitlink_*() helper functions
 + resolve_gitlink_ref(): improve docstring
 + get_ref_dir(): change signature
 + refs: change signatures of get_packed_refs() and get_loose_refs()
 + is_dup_ref(): extract function from sort_ref_array()
 + add_ref(): add docstring
 + parse_ref_line(): add docstring
 + is_refname_available(): remove the "quiet" argument
 + clear_ref_array(): rename from free_ref_array()
 + refs: rename parameters result -> sha1
 + refs: rename "refname" variables
 + struct ref_entry: document name member
 (this branch is used by mh/ref-api-rest.)

Later part split out to expedite moving the earlier good bits forward.

* nd/war-on-nul-in-commit (2011-12-15) 3 commits
  (merged to 'next' on 2011-12-20 at d441111)
 + commit_tree(): refuse commit messages that contain NULs
 + Convert commit_tree() to take strbuf as message
 + merge: abort if fails to commit

* rs/diff-tree-combined-clean-up (2011-12-17) 3 commits
  (merged to 'next' on 2011-12-20 at 265e049)
 + submodule: use diff_tree_combined_merge() instead of diff_tree_combined()
 + pass struct commit to diff_tree_combined_merge()
 + use struct sha1_array in diff_tree_combined()

* tr/grep-threading (2011-12-16) 3 commits
  (merged to 'next' on 2011-12-20 at 1a852ef)
 + grep: disable threading in non-worktree case
 + grep: enable threading with -p and -W using lazy attribute lookup
 + grep: load funcname patterns for -W

--------------------------------------------------
[Stalled]

* pw/p4-docs-and-tests (2011-12-18) 11 commits
 - git-p4: document and test submit options
 - git-p4: test and document --use-client-spec
 - git-p4: test --keep-path
 - git-p4: test --max-changes
 - git-p4: document and test --import-local
 - git-p4: honor --changesfile option and test
 - git-p4: document and test clone --branch
 - git-p4: test cloning with two dirs, clarify doc
 - git-p4: clone does not use --git-dir
 - git-p4: test debug macro
 - git-p4: introduce asciidoc documentation

Waiting for a reroll.

* jc/advise-push-default (2011-12-18) 1 commit
 - push: hint to use push.default=upstream when appropriate

Peff had a good suggestion outlining an updated code structure so that
somebody new can try to dip his or her toes in the development. Any
takers?

Waiting for a reroll.

* mh/ref-api-rest (2011-12-12) 35 commits
 - repack_without_ref(): call clear_packed_ref_cache()
 - read_packed_refs(): keep track of the directory being worked in
 - is_refname_available(): query only possibly-conflicting references
 - refs: read loose references lazily
 - read_loose_refs(): take a (ref_entry *) as argument
 - struct ref_dir: store a reference to the enclosing ref_cache
 - sort_ref_dir(): take (ref_entry *) instead of (ref_dir *)
 - do_for_each_ref_in_dir*(): take (ref_entry *) instead of (ref_dir *)
 - add_entry(): take (ref_entry *) instead of (ref_dir *)
 - search_ref_dir(): take (ref_entry *) instead of (ref_dir *)
 - find_containing_direntry(): use (ref_entry *) instead of (ref_dir *)
 - add_ref(): take (ref_entry *) instead of (ref_dir *)
 - read_packed_refs(): take (ref_entry *) instead of (ref_dir *)
 - find_ref(): take (ref_entry *) instead of (ref_dir *)
 - is_refname_available(): take (ref_entry *) instead of (ref_dir *)
 - get_loose_refs(): return (ref_entry *) instead of (ref_dir *)
 - get_packed_refs(): return (ref_entry *) instead of (ref_dir *)
 - refs: wrap top-level ref_dirs in ref_entries
 - get_ref_dir(): keep track of the current ref_dir
 - do_for_each_ref(): only iterate over the subtree that was requested
 - refs: sort ref_dirs lazily
 - sort_ref_dir(): do not sort if already sorted
 - refs: store references hierarchically
 - refs.c: rename ref_array -> ref_dir
 - struct ref_entry: nest the value part in a union
 - check_refname_component(): return 0 for zero-length components
 - free_ref_entry(): new function
 - refs.c: reorder definitions more logically
 - is_refname_available(): reimplement using do_for_each_ref_in_array()
 - names_conflict(): simplify implementation
 - names_conflict(): new function, extracted from is_refname_available()
 - repack_without_ref(): reimplement using do_for_each_ref_in_array()
 - do_for_each_ref_in_arrays(): new function
 - do_for_each_ref_in_array(): new function
 - do_for_each_ref(): correctly terminate while processesing extra_refs

The API for extra anchoring points may require rethought first; that would
hopefully make the "ref" part a lot simpler.

Waiting for a reroll.

* jc/split-blob (2011-12-01) 6 commits
 . WIP (streaming chunked)
 - chunked-object: fallback checkout codepaths
 - bulk-checkin: support chunked-object encoding
 - bulk-checkin: allow the same data to be multiply hashed
 - new representation types in the packstream
 - varint-in-pack: refactor varint encoding/decoding

Not ready.

At least pack-objects and fsck need to learn the new encoding for the
series to be usable locally, and then index-pack/unpack-objects needs to
learn it to be used remotely.

--------------------------------------------------
[Cooking]

* jn/maint-gitweb-utf8-fix (2011-12-19) 4 commits
  (merged to 'next' on 2011-12-20 at b816812)
 + gitweb: Fix fallback mode of to_utf8 subroutine
 + gitweb: Output valid utf8 in git_blame_common('data')
 + gitweb: esc_html() site name for title in OPML
 + gitweb: Call to_utf8() on input string in chop_and_escape_str()

* tr/pty-all (2011-12-19) 1 commit
  (merged to 'next' on 2011-12-20 at 9b637d3)
 + test-terminal: set output terminals to raw mode

Kept only the second one from the original.

* rr/revert-cherry-pick (2011-12-15) 6 commits
  (merged to 'next' on 2011-12-21 at d0428dc)
 + t3502, t3510: clarify cherry-pick -m failure
 + t3510 (cherry-pick-sequencer): use exit status
 + revert: simplify getting commit subject in format_todo()
 + revert: tolerate extra spaces, tabs in insn sheet
 + revert: make commit subjects in insn sheet optional
 + revert: free msg in format_todo()

* jc/signed-commit (2011-11-29) 5 commits
  (merged to 'next' on 2011-12-21 at 8fcbf00)
 + gpg-interface: allow use of a custom GPG binary
 + pretty: %G[?GS] placeholders
 + test "commit -S" and "log --show-signature"
 + log: --show-signature
 + commit: teach --gpg-sign option

* jc/push-ignore-stale (2011-12-14) 2 commits
 - push: --ignore-stale option
 - set_ref_status_for_push(): use transport-flags abstraction

Probably solving a wrong problem and encouraging a wrong workflow while at
it. jc/advise-push-default might be a better approach.

Will drop.

^ permalink raw reply

* Re: [RFC/PATCH] i18n of multi-line messages
From: Ævar Arnfjörð Bjarmason @ 2011-12-22 21:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, git
In-Reply-To: <7vaa6ldpk6.fsf@alter.siamese.dyndns.org>

On Thu, Dec 22, 2011 at 08:38, Junio C Hamano <gitster@pobox.com> wrote:

[Re-formatted for clarity]

> -       vreportf("hint: ", advice, params);
> +       vreportf("hint", advice, params);
> -               vreportf("fatal: ", err, params);
> +               vreportf("fatal", err, params);
> -       vwritef(child_err, "fatal: ", err, params);
> +       vwritef(child_err, "fatal", err, params);
> -       vreportf("usage: ", err, params);
> +       vreportf("usage", err, params);
> -       vreportf("fatal: ", err, params);
> +       vreportf("fatal", err, params);
> -       vreportf("error: ", err, params);
> +       vreportf("error", err, params);
> -       vreportf("warning: ", warn, params);
> +       vreportf("warning", warn, params);

If we do it like this these would have to have something like:

    vreportf(N_("warning"), warn, params);

Followed by...:

> +       strbuf_vaddf(&buf, fmt, params);
> +       for (cp = buf.buf; *cp; cp = np) {
> +               np = strchrnul(cp, '\n');
> +               /*
> +                * TRANSLATORS: the format is designed so that in RTL
> +                * languages you could reorder and put the "prefix" at
> +                * the end instead of the beginning of a line if you
> +                * wanted to.
> +                */
> +               strbuf_addf(&line,
> +                           _("%s: %.*s\n"),
> +                           prefix,

Changing this to _(prefix).

> +                           (int)(np - cp), cp);
> +               emit(&line, cb_data);
> +               strbuf_reset(&line);
> +               if (*np)
> +                       np++;
> +       }
> +       strbuf_release(&buf);
> +       strbuf_release(&line);

But ideally to make things clear to the translators it's better to
give them something like this to translate:

    error: %s
    message

Instead of just, as two separate things:

    error
    message

Because:

 1. We might use "error", "warning", "usage" etc. somewhere else, and
    unless we start using the msgctxt feature of gettext we can't
    distinguish between these.

 2. If you present them as two separate things the translator is
    likely to get the case wrong (e.g. translate "error" in the
    nominative case instead of say accusative).

But it's not a big deal, the patch looks good to me as-is with those
N_() and _() changes. Just something to keep in mind.

We can always fixed issues like the one I'm raising later as they crop up.

^ permalink raw reply

* Re: Patch to support proxy authentication through NTLM?
From: Ævar Arnfjörð Bjarmason @ 2011-12-23  1:43 UTC (permalink / raw)
  To: Schmidt, Marco; +Cc: git
In-Reply-To: <4CDEC141B5583D408E79F2931DB7708301691B80@GSX300A.mxchg.m.corp>

On Thu, Dec 22, 2011 at 09:45, Schmidt, Marco
<Marco.Schmidt@cassidian.com> wrote:

> After debugging git proxy authentication and creating my own fix to
> support git+https over an NTLM proxy I found a set of patches inside of
> the mailing list archives [1]. What is the state of this patch set? The
> essence of the patch would be to allow NTLM authentification by giving
> the correct options to libcurl.

~Weekly Junio sends out a "What's cooking in Git" E-Mail. Things that
aren't listed there aren't being actively considered for inclusion.

Which means that if you're interested in it the best thing you can do
is to take that patch, rebase it on top of master, make sure it works,
and re-submit it.

See Documentation/SubmittingPatches and one of those E-Mails Junios
sends out for more info.

^ permalink raw reply

* Re: Patch to support proxy authentication through NTLM?
From: Junio C Hamano @ 2011-12-23  2:34 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Schmidt, Marco, git
In-Reply-To: <CACBZZX4FS37zqY3eUKHK+FGMjXB4D1DEi17hQSPsmQBS9E8jUA@mail.gmail.com>

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> Which means that if you're interested in it the best thing you can do
> is to take that patch, rebase it on top of master, make sure it works,
> and re-submit it.

In the case of that particular patch, it appears to take more than that,
unless you meant "make it work" by "make sure it works". The discussion
following patch seems to indicate that it was very broken and not working
at all, and then the patch submitter disappeared.

^ permalink raw reply

* Re: [PATCH] attr: map builtin userdiff drivers to well-known extensions
From: Jeff King @ 2011-12-23  5:47 UTC (permalink / raw)
  To: Philip Oakley; +Cc: Junio C Hamano, git, Brandon Casey
In-Reply-To: <22866D05066E43DEA0A0EBDF9B7686ED@PhilipOakley>

On Thu, Dec 22, 2011 at 12:05:39AM -0000, Philip Oakley wrote:

> The "*.m=matlab" does give better (proper) hunk headers as it picks
> out the "^%%" comment line which starts a code block . For option 3
> (ObjC) they are empty (which is poor). The plain vanila (default)
> hunk headers are so-so.

Thanks for all of the detail. I think it comes down to the part I
quoted, though: it is indeed a disservice to matlab people to map "*.m"
to objc. So let's be conservative and not do that (projects can always
add their own gitattributes).

(Even before seeing your answer, I dropped it from the re-roll of my
patch that I sent, but this confirms to me that it was the right thing
to do).

-Peff

^ permalink raw reply

* Re: [RFC/PATCH] i18n of multi-line messages
From: Johannes Sixt @ 2011-12-23  6:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Ævar Arnfjörð Bjarmason
In-Reply-To: <7v39cceay0.fsf@alter.siamese.dyndns.org>

Am 12/22/2011 19:08, schrieb Junio C Hamano:
> I _think_ I liked the simplicity of having the logic to
> 
>  - format localized message to a multi-line buffer; and
>  - split the contents of that buffer into lines and add prefix in an
>    i18n friendly way
> 
> in vreportf(), but there are many problems in this approach, it seems.  We
> may need to limit the message length for error()/die() codepath, but we do
> not want to be limited in others, definitely not from advise().
> 
> Also some calls to error() are meant to produce plumbing error message and
> should never be localized. The approach to localize the prefix in vreportf()
> will not work for this reason.

IMO the solution to not translate plumbing messages is to omit the
initialization of the gettext machinery.

Anyway, here is a patch that modifies vreportf() in an i18n friendly way
(I think). It is not necessarily meant for inclusion. Notably, the
changes to the test suite indicate one problem in a class of error()
messages: A list of file names is produced that are indented by a tab.
But with the "error: " prefix, the visible indentation shrinks to two
spaces (the minimum possible). We may want to do something about it.

--- >8 ---
From: Johannes Sixt <j6t@kdbg.org>
Subject: [PATCH] Put a prefix on all lines of multi-line hint, warning,
 error messages

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 advice.c                             |    2 +-
 git-compat-util.h                    |    2 +-
 http-backend.c                       |    2 +-
 run-command.c                        |    2 +-
 t/t1011-read-tree-sparse-checkout.sh |    6 ++--
 t/t1506-rev-parse-diagnosis.sh       |    2 +-
 t/t7607-merge-overwrite.sh           |    6 ++--
 t/t7609-merge-co-error-msgs.sh       |   40 +++++++++++++++++-----------------
 usage.c                              |   19 +++++++++++-----
 9 files changed, 44 insertions(+), 37 deletions(-)

diff --git a/advice.c b/advice.c
index e02e632..38b55b6 100644
--- a/advice.c
+++ b/advice.c
@@ -24,7 +24,7 @@ void advise(const char *advice, ...)
 	va_list params;
 
 	va_start(params, advice);
-	vreportf("hint: ", advice, params);
+	vreportf("hint: %s\n", advice, params);
 	va_end(params);
 }
 
diff --git a/git-compat-util.h b/git-compat-util.h
index 8f3972c..26b7d19 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -239,7 +239,7 @@ extern char *gitbasename(char *);
 #include "compat/bswap.h"
 
 /* General helper functions */
-extern void vreportf(const char *prefix, const char *err, va_list params);
+extern void vreportf(const char *line_fmt, const char *err, va_list params);
 extern void vwritef(int fd, const char *prefix, const char *err, va_list params);
 extern NORETURN void usage(const char *err);
 extern NORETURN void usagef(const char *err, ...) __attribute__((format (printf, 1, 2)));
diff --git a/http-backend.c b/http-backend.c
index 869d515..fb91742 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -490,7 +490,7 @@ static NORETURN void die_webcgi(const char *err, va_list params)
 		hdr_nocache();
 		end_headers();
 
-		vreportf("fatal: ", err, params);
+		vreportf("fatal: %s\n", err, params);
 	}
 	exit(0); /* we successfully reported a failure ;-) */
 }
diff --git a/run-command.c b/run-command.c
index 1c51043..664c215 100644
--- a/run-command.c
+++ b/run-command.c
@@ -466,7 +466,7 @@ static void *run_thread(void *data)
 
 static NORETURN void die_async(const char *err, va_list params)
 {
-	vreportf("fatal: ", err, params);
+	vreportf("fatal: %s\n", err, params);
 
 	if (!pthread_equal(main_thread, pthread_self())) {
 		struct async *async = pthread_getspecific(async_key);
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index 5c0053a..22b6a20 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -242,9 +242,9 @@ test_expect_success 'print errors when failed to update worktree' '
 	test_must_fail git checkout top 2>actual &&
 	cat >expected <<\EOF &&
 error: The following untracked working tree files would be overwritten by checkout:
-	sub/added
-	sub/addedtoo
-Please move or remove them before you can switch branches.
+error: 	sub/added
+error: 	sub/addedtoo
+error: Please move or remove them before you can switch branches.
 Aborting
 EOF
 	test_cmp expected actual
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 0843a1c..292f2fb 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -11,7 +11,7 @@ test_did_you_mean ()
 	sq="'" &&
 	cat >expected <<-EOF &&
 	fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
-	Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
+	fatal: Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
 	EOF
 	test_cmp expected error
 }
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index aa74184..7d6498d 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -104,9 +104,9 @@ test_expect_success 'will not overwrite untracked subtree' '
 
 cat >expect <<\EOF
 error: The following untracked working tree files would be overwritten by merge:
-	sub
-	sub2
-Please move or remove them before you can merge.
+error: 	sub
+error: 	sub2
+error: Please move or remove them before you can merge.
 Aborting
 EOF
 
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh
index 0e4a682..653eb7e 100755
--- a/t/t7609-merge-co-error-msgs.sh
+++ b/t/t7609-merge-co-error-msgs.sh
@@ -27,11 +27,11 @@ test_expect_success 'setup' '
 
 cat >expect <<\EOF
 error: The following untracked working tree files would be overwritten by merge:
-	five
-	four
-	three
-	two
-Please move or remove them before you can merge.
+error: 	five
+error: 	four
+error: 	three
+error: 	two
+error: Please move or remove them before you can merge.
 Aborting
 EOF
 
@@ -50,13 +50,13 @@ test_expect_success 'untracked files overwritten by merge (fast and non-fast for
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by merge:
-	four
-	three
-	two
-Please, commit your changes or stash them before you can merge.
+error: 	four
+error: 	three
+error: 	two
+error: Please, commit your changes or stash them before you can merge.
 error: The following untracked working tree files would be overwritten by merge:
-	five
-Please move or remove them before you can merge.
+error: 	five
+error: Please move or remove them before you can merge.
 Aborting
 EOF
 
@@ -70,9 +70,9 @@ test_expect_success 'untracked files or local changes ovewritten by merge' '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
-	rep/one
-	rep/two
-Please, commit your changes or stash them before you can switch branches.
+error: 	rep/one
+error: 	rep/two
+error: Please, commit your changes or stash them before you can switch branches.
 Aborting
 EOF
 
@@ -92,9 +92,9 @@ test_expect_success 'cannot switch branches because of local changes' '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
-	rep/one
-	rep/two
-Please, commit your changes or stash them before you can switch branches.
+error: 	rep/one
+error: 	rep/two
+error: Please, commit your changes or stash them before you can switch branches.
 Aborting
 EOF
 
@@ -106,9 +106,9 @@ test_expect_success 'not uptodate file porcelain checkout error' '
 
 cat >expect <<\EOF
 error: Updating the following directories would lose untracked files in it:
-	rep
-	rep2
-
+error: 	rep
+error: 	rep2
+error: 
 Aborting
 EOF
 
diff --git a/usage.c b/usage.c
index a2a6678..1b55afd 100644
--- a/usage.c
+++ b/usage.c
@@ -6,11 +6,18 @@
 #include "git-compat-util.h"
 #include "cache.h"
 
-void vreportf(const char *prefix, const char *err, va_list params)
+void vreportf(const char *line_fmt, const char *err, va_list params)
 {
 	char msg[4096];
+	char *line, *end;
+
 	vsnprintf(msg, sizeof(msg), err, params);
-	fprintf(stderr, "%s%s\n", prefix, msg);
+
+	for (line = msg; (end = strchr(line, '\n')); line = end) {
+		*end++ = 0;
+		fprintf(stderr, line_fmt, line);
+	}
+	fprintf(stderr, line_fmt, line);
 }
 
 void vwritef(int fd, const char *prefix, const char *err, va_list params)
@@ -27,24 +34,24 @@ void vwritef(int fd, const char *prefix, const char *err, va_list params)
 
 static NORETURN void usage_builtin(const char *err, va_list params)
 {
-	vreportf("usage: ", err, params);
+	vreportf("usage: %s\n", err, params);
 	exit(129);
 }
 
 static NORETURN void die_builtin(const char *err, va_list params)
 {
-	vreportf("fatal: ", err, params);
+	vreportf("fatal: %s\n", err, params);
 	exit(128);
 }
 
 static void error_builtin(const char *err, va_list params)
 {
-	vreportf("error: ", err, params);
+	vreportf("error: %s\n", err, params);
 }
 
 static void warn_builtin(const char *warn, va_list params)
 {
-	vreportf("warning: ", warn, params);
+	vreportf("warning: %s\n", warn, params);
 }
 
 /* If we are in a dlopen()ed .so write to a global variable would segfault
-- 
1.7.8.rc0.126.gd15506

^ permalink raw reply related

* Re: [PATCH] Specify a precision for the length of a subject string
From: Miles Bader @ 2011-12-23  9:41 UTC (permalink / raw)
  To: nathan.panike; +Cc: Andreas Schwab, git
In-Reply-To: <20111221145352.GB13097@llunet.cs.wisc.edu>

Nathan Panike <nwp@cs.wisc.edu> writes:
>> > $ git log --pretty='%h %30s' d165204 -1
>> 
>> In C's formatted output this syntax denotes a minimum field width, not a
>> precision, so it will probably be surprising to many people.
>
> C semantics are already broken because (from git-log(1))
>
> "If you add a - (minus sign) after % of a placeholder, line-feeds that
> immediately precede the expansion are deleted if and only if the placeholder
> expands to an empty string."
>
> rather than indicating justification of the field.

There's no reason to make it _worse_ though...

For your desired feature, why not just use the C printf syntax for this
functionality, a leading dot before the max length?  E.g. "%.30s".

-miles

-- 
Youth, n. The Period of Possibility, when Archimedes finds a fulcrum,
Cassandra has a following and seven cities compete for the honor of endowing a
living Homer.

^ permalink raw reply

* Re: [PATCH] Specify a precision for the length of a subject string
From: Jeff King @ 2011-12-23 10:09 UTC (permalink / raw)
  To: nathan.panike; +Cc: git
In-Reply-To: <20111221145112.GA13097@llunet.cs.wisc.edu>

On Wed, Dec 21, 2011 at 08:51:13AM -0600, Nathan Panike wrote:

> > Hmm. I think the idea of limiting is OK (though personally, I would just
> > pipe through a filter that truncates long lines). But I'm a bit negative
> > on adding a tweak like this that only affects the subject. Is there a
> > reason I couldn't do %30gs, or %30f, or even some other placeholder?
> 
> The ones that make sense to limit are all those that depend on the subject, as the
> above; it does not make sense to limit other fields that don't depend on the
> subject, as they are fixed width, or have small variance. And it does not make
> sense to me to limit the length of the body.

I agree the subject is the most likely place. I was thinking one might
want to do it with the body, too. But whether it would be "I want N
bytes of the body" or "truncate each body line at N bytes without
wrapping", I don't know.

-Peff

^ permalink raw reply

* Re: [PATCH] Specify a precision for the length of a subject string
From: Jeff King @ 2011-12-23 10:35 UTC (permalink / raw)
  To: nathan.panike; +Cc: git
In-Reply-To: <20111223100957.GA1247@sigill.intra.peff.net>

On Fri, Dec 23, 2011 at 05:09:58AM -0500, Jeff King wrote:

> > The ones that make sense to limit are all those that depend on the subject, as the
> > above; it does not make sense to limit other fields that don't depend on the
> > subject, as they are fixed width, or have small variance. And it does not make
> > sense to me to limit the length of the body.
> 
> I agree the subject is the most likely place. I was thinking one might
> want to do it with the body, too. But whether it would be "I want N
> bytes of the body" or "truncate each body line at N bytes without
> wrapping", I don't know.

Another place that might want it is %N (commit notes).

Here's how I would have done it. Not involving %w at all, but applying
equally to all placeholders.

  [1/2]: pretty: refactor --format "magic" placeholders
  [2/2]: pretty: allow "max-size" magic for all placeholders

I'm not personally interested in this topic, so I won't be pushing for
this to be included in git. But if it feels like the right direction for
you, feel free to be build on it and post it as part of your series (or
just take it as inspiration and make your own commits). Off the top of
my head, it needs:

  - documentation updates
  - tests
  - userformat_want_item should also respect the same magic (it already
    duplicates some of the "-/+/ " magic. It might be nice to factor
    that part out).

-Peff

^ permalink raw reply

* [PATCH 1/2] pretty: refactor --format "magic" placeholders
From: Jeff King @ 2011-12-23 10:35 UTC (permalink / raw)
  To: nathan.panike; +Cc: git
In-Reply-To: <20111223100957.GA1247@sigill.intra.peff.net>

Instead of assuming each magic token is a single character,
let's handle arbitrary-sized magic.

Signed-off-by: Jeff King <peff@peff.net>
---
 pretty.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pretty.c b/pretty.c
index 230fe1c..7b4d098 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1018,6 +1018,7 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
 				 void *context)
 {
 	int consumed;
+	int magic_len = 0;
 	size_t orig_len;
 	enum {
 		NO_MAGIC,
@@ -1039,13 +1040,13 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
 	default:
 		break;
 	}
-	if (magic != NO_MAGIC)
+	if (magic != NO_MAGIC) {
+		magic_len++;
 		placeholder++;
+	}
 
 	orig_len = sb->len;
 	consumed = format_commit_one(sb, placeholder, context);
-	if (magic == NO_MAGIC)
-		return consumed;
 
 	if ((orig_len == sb->len) && magic == DEL_LF_BEFORE_EMPTY) {
 		while (sb->len && sb->buf[sb->len - 1] == '\n')
@@ -1056,7 +1057,7 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
 		else if (magic == ADD_SP_BEFORE_NON_EMPTY)
 			strbuf_insert(sb, orig_len, " ", 1);
 	}
-	return consumed + 1;
+	return consumed + magic_len;
 }
 
 static size_t userformat_want_item(struct strbuf *sb, const char *placeholder,
-- 
1.7.8.1.3.gba11d

^ permalink raw reply related

* [PATCH 2/2] pretty: allow "max-size" magic for all placeholders
From: Jeff King @ 2011-12-23 10:36 UTC (permalink / raw)
  To: nathan.panike; +Cc: git
In-Reply-To: <20111223100957.GA1247@sigill.intra.peff.net>

You can now truncate a given placeholder to no more than a
certain number of characters with something like "%30s".

Signed-off-by: Jeff King <peff@peff.net>
---
This just uses the made-up "%30s" syntax, but you could easily tweak it
to handle "%.30s" or whatever.

 pretty.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/pretty.c b/pretty.c
index 7b4d098..06d96a7 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1019,6 +1019,7 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
 {
 	int consumed;
 	int magic_len = 0;
+	int max_len = 0;
 	size_t orig_len;
 	enum {
 		NO_MAGIC,
@@ -1045,9 +1046,22 @@ static size_t format_commit_item(struct strbuf *sb, const char *placeholder,
 		placeholder++;
 	}
 
+	if (isdigit(placeholder[0])) {
+		char *end;
+		max_len = strtoul(placeholder, &end, 10);
+		magic_len += (end - placeholder);
+		placeholder = end;
+	}
+
 	orig_len = sb->len;
 	consumed = format_commit_one(sb, placeholder, context);
 
+	if (max_len) {
+		size_t end = orig_len + max_len;
+		if (end < sb->len)
+			strbuf_setlen(sb, end);
+	}
+
 	if ((orig_len == sb->len) && magic == DEL_LF_BEFORE_EMPTY) {
 		while (sb->len && sb->buf[sb->len - 1] == '\n')
 			strbuf_setlen(sb, sb->len - 1);
-- 
1.7.8.1.3.gba11d

^ permalink raw reply related

* I can never finish a push
From: Martin L Resnick @ 2011-12-23 13:11 UTC (permalink / raw)
  To: git

I'm working remotely over a VERY slow line.

When I do a push it starts out fine
but after the 15 seconds it takes to push
it fails with non-fast-forward merge.

So I pull (no merge needed, its fast-forward)
and try push again. Fails again.

I can keep this up for hours on end;
pushing, pulling, pushing, pulling.
Apparently there is fast and furious development
on the branch I'm on that during my 15 seconds
of pushing someone else on-site pushes and adds
new commits before mine can finish.

Is there anyway to lock the repository while
my push is going on ?

Please don't ask why I have a slow line
or why the volume of changes that I am pushing.
Suffice it to say its military work.

^ permalink raw reply

* Re: I can never finish a push
From: Thomas Rast @ 2011-12-23 14:18 UTC (permalink / raw)
  To: Martin L Resnick; +Cc: git
In-Reply-To: <4EF47DF3.9080809@bbn.com>

Martin L Resnick <mresnick@bbn.com> writes:

> I'm working remotely over a VERY slow line.
>
> When I do a push it starts out fine
> but after the 15 seconds it takes to push
> it fails with non-fast-forward merge.
>
> So I pull (no merge needed, its fast-forward)
> and try push again. Fails again.
>
> I can keep this up for hours on end;
> pushing, pulling, pushing, pulling.
> Apparently there is fast and furious development
> on the branch I'm on that during my 15 seconds
> of pushing someone else on-site pushes and adds
> new commits before mine can finish.
>
> Is there anyway to lock the repository while
> my push is going on ?

Git doesn't have any locking features.

Your best bet is probably to have someone with faster access merge your
branch, e.g., by pushing your work elsewhere (to another repo or just
a different branch) and then sending them an email asking for your work
to be merged.

If you have this issue a lot, the admins of your repo server could
probably arrange for a feature where you push to a special "please merge
this" branch namespace (such as incoming/martin-resnick), and the server
then does the merge for you using locking (and of course refusing if
there was any conflict).


However, it somewhat eludes me how you can generate churn on the order
of 2000 commits (8*3600/15) per workday *to the same repository*.
Perhaps the repository should be split into subprojects?  Or at the very
least, the subprojects should be handled in different repositories, from
which an integrator pulls together the daily latest-and-greatest across
all subprojects?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* Re: I can never finish a push
From: demerphq @ 2011-12-23 14:19 UTC (permalink / raw)
  To: Martin L Resnick; +Cc: git
In-Reply-To: <4EF47DF3.9080809@bbn.com>

On 23 December 2011 14:11, Martin L Resnick <mresnick@bbn.com> wrote:
> I'm working remotely over a VERY slow line.
>
> When I do a push it starts out fine
> but after the 15 seconds it takes to push
> it fails with non-fast-forward merge.
>
> So I pull (no merge needed, its fast-forward)
> and try push again. Fails again.
>
> I can keep this up for hours on end;
> pushing, pulling, pushing, pulling.
> Apparently there is fast and furious development
> on the branch I'm on that during my 15 seconds
> of pushing someone else on-site pushes and adds
> new commits before mine can finish.
>
> Is there anyway to lock the repository while
> my push is going on ?
>
> Please don't ask why I have a slow line
> or why the volume of changes that I am pushing.
> Suffice it to say its military work.

Maybe try pushing a branch and then having a colleague with a faster
connection do the merge for you.

yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

^ permalink raw reply

* Re: I can never finish a push
From: Johannes Sixt @ 2011-12-23 14:39 UTC (permalink / raw)
  To: Martin L Resnick; +Cc: git
In-Reply-To: <4EF47DF3.9080809@bbn.com>

Am 12/23/2011 14:11, schrieb Martin L Resnick:
> I'm working remotely over a VERY slow line.
> 
> When I do a push it starts out fine
> but after the 15 seconds it takes to push
> it fails with non-fast-forward merge.
> 
> So I pull (no merge needed, its fast-forward)
> and try push again. Fails again.
> 
> I can keep this up for hours on end;
> pushing, pulling, pushing, pulling.

Your statements can only make sense if the pushed branch generates a
"non-fast-forward" is not the same branch that you pull. Show a transcript
of your commands, and in particular also tell your setting of push.default.

-- Hannes

^ permalink raw reply

* Re: I can never finish a push
From: Andreas Schwab @ 2011-12-23 14:39 UTC (permalink / raw)
  To: Martin L Resnick; +Cc: git
In-Reply-To: <4EF47DF3.9080809@bbn.com>

Martin L Resnick <mresnick@bbn.com> writes:

> So I pull (no merge needed, its fast-forward)

If the merge is fast-forward then you aren't really having anything to
push, are you?  Are you sure you are pushing the right branch?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: "Nested quantifiers" error in gitweb with "++" in the filename
From: demerphq @ 2011-12-23 16:02 UTC (permalink / raw)
  To: Jehan Bing; +Cc: git
In-Reply-To: <jd04eq$9m0$1@dough.gmane.org>

On 22 December 2011 21:37, Jehan Bing <jehan@orb.com> wrote:
> Hi,
>
> I'm getting an error when trying to look at a blob when the filename has
> "++" in it:
>
> http://.../blob/13ec1624fefc23d20d0407aac3337b35844a2ceb:/foo-++.txt

This error comes because the filename is being used a pattern without
being protected by a quotemeta.

Interestingly, a later version of perl would not have this problem as
++ is a legal quantifier as of 5.10, nevertheless it probably wouldnt
do what you expected.

yves
-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

^ permalink raw reply

* [PATCH] fix shell command line in example
From: Joey Hess @ 2011-12-23 16:41 UTC (permalink / raw)
  To: git

The comma was probably intended to be a semicolon so that the
two commands can be run by cut-n-paste.

Signed-off-by: Joey Hess <joey@kitenet.net>
---
 Documentation/git-pull.txt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 0f18ec8..628695d 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -194,7 +194,7 @@ EXAMPLES
   current branch:
 +
 ------------------------------------------------
-$ git pull, git pull origin
+$ git pull; git pull origin
 ------------------------------------------------
 +
 Normally the branch merged in is the HEAD of the remote repository,
-- 
1.7.7.3

^ permalink raw reply related

* Re: [PATCH] fix shell command line in example
From: Thomas Rast @ 2011-12-23 16:56 UTC (permalink / raw)
  To: Joey Hess; +Cc: git
In-Reply-To: <20111223164128.GA21918@gnu.kitenet.net>

Joey Hess <joey@kitenet.net> writes:

> The comma was probably intended to be a semicolon so that the
> two commands can be run by cut-n-paste.
[...]
>  ------------------------------------------------
> -$ git pull, git pull origin
> +$ git pull; git pull origin
>  ------------------------------------------------

Would it ever make sense to run the two in sequence?

But upon closer reading, it seems to be a pretty terrible example
anyway.  It reads:

  * Update the remote-tracking branches for the repository
    you cloned from, then merge one of them into your
    current branch:
  +
  ------------------------------------------------
  $ git pull, git pull origin
  ------------------------------------------------
  +
  Normally the branch merged in is the HEAD of the remote repository,
  but the choice is determined by the branch.<name>.remote and
  branch.<name>.merge options; see linkgit:git-config[1] for details.

But that "normally" is no longer true: with default configs, the user
would only ever have branches with tracking already set up.  So
*normally*, 'git pull' will merge the @{upstream}.

'git pull origin' is even worse: with tracking configured, it goes out
of its way to verify that the specified remote (origin) is actually what
HEAD tracks[*].  So 'git pull origin' with default configs means "please
pull, but double-check me on the choice of remote".  Do we want to give
that to a user as the second example?

So I'm thinking it should just read

  * Update the upstream origin of the current branch, then merge the
    tracked branch into the current one:
  +
  --------------------------------------------------
  $ git pull
  --------------------------------------------------

modulo avoiding confusion around upstream/tracking.


[*] a8c9bef (pull: improve advice for unconfigured error case,
2009-10-05) has a long explanation on the subject.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply

* [PATCH] Remove Git's support for smoke testing
From: Ævar Arnfjörð Bjarmason @ 2011-12-23 17:08 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

I'm no longer running the Git smoke testing service at
smoke.git.nix.is due to Smolder being a fragile piece of software not
having time to follow through on making it easy for third parties to
run and submit their own smoke tests.

So remove the support in Git for sending smoke tests to
smoke.git.nix.is, it's still easy to modify the test suite to submit
smokes somewhere else.

This reverts the following commits:

    Revert "t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target" -- e38efac87d
    Revert "t/README: Document the Smoke testing" -- d15e9ebc5c
    Revert "t/Makefile: Create test-results dir for smoke target" -- 617344d77b
    Revert "tests: Infrastructure for Git smoke testing" -- b6b84d1b74

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/Makefile |   40 +--------------------------------
 t/README   |   73 ------------------------------------------------------------
 t/harness  |   21 -----------------
 3 files changed, 1 insertions(+), 133 deletions(-)
 delete mode 100755 t/harness

diff --git a/t/Makefile b/t/Makefile
index 9046ec9..52a23ff 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -73,42 +73,4 @@ gitweb-test:
 valgrind:
 	$(MAKE) GIT_TEST_OPTS="$(GIT_TEST_OPTS) --valgrind"
 
-# Smoke testing targets
--include ../GIT-VERSION-FILE
-uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo unknown')
-uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo unknown')
-
-test-results:
-	mkdir -p test-results
-
-test-results/git-smoke.tar.gz: test-results
-	$(PERL_PATH) ./harness \
-		--archive="test-results/git-smoke.tar.gz" \
-		$(T)
-
-smoke: test-results/git-smoke.tar.gz
-
-SMOKE_UPLOAD_FLAGS =
-ifdef SMOKE_USERNAME
-	SMOKE_UPLOAD_FLAGS += -F username="$(SMOKE_USERNAME)" -F password="$(SMOKE_PASSWORD)"
-endif
-ifdef SMOKE_COMMENT
-	SMOKE_UPLOAD_FLAGS += -F comments="$(SMOKE_COMMENT)"
-endif
-ifdef SMOKE_TAGS
-	SMOKE_UPLOAD_FLAGS += -F tags="$(SMOKE_TAGS)"
-endif
-
-smoke_report: smoke
-	curl \
-		-H "Expect: " \
-		-F project=Git \
-		-F architecture="$(uname_M)" \
-		-F platform="$(uname_S)" \
-		-F revision="$(GIT_VERSION)" \
-		-F report_file=@test-results/git-smoke.tar.gz \
-		$(SMOKE_UPLOAD_FLAGS) \
-		http://smoke.git.nix.is/app/projects/process_add_report/1 \
-	| grep -v ^Redirecting
-
-.PHONY: pre-clean $(T) aggregate-results clean valgrind smoke smoke_report
+.PHONY: pre-clean $(T) aggregate-results clean valgrind
diff --git a/t/README b/t/README
index c85abaf..681e8b4 100644
--- a/t/README
+++ b/t/README
@@ -658,76 +658,3 @@ Then, at the top-level:
 That'll generate a detailed cover report in the "cover_db_html"
 directory, which you can then copy to a webserver, or inspect locally
 in a browser.
-
-Smoke testing
--------------
-
-The Git test suite has support for smoke testing. Smoke testing is
-when you submit the results of a test run to a central server for
-analysis and aggregation.
-
-Running a smoke tester is an easy and valuable way of contributing to
-Git development, particularly if you have access to an uncommon OS on
-obscure hardware.
-
-After building Git you can generate a smoke report like this in the
-"t" directory:
-
-    make clean smoke
-
-You can also pass arguments via the environment. This should make it
-faster:
-
-    GIT_TEST_OPTS='--root=/dev/shm' TEST_JOBS=10 make clean smoke
-
-The "smoke" target will run the Git test suite with Perl's
-"TAP::Harness" module, and package up the results in a .tar.gz archive
-with "TAP::Harness::Archive". The former is included with Perl v5.10.1
-or later, but you'll need to install the latter from the CPAN. See the
-"Test coverage" section above for how you might do that.
-
-Once the "smoke" target finishes you'll see a message like this:
-
-    TAP Archive created at <path to git>/t/test-results/git-smoke.tar.gz
-
-To upload the smoke report you need to have curl(1) installed, then
-do:
-
-    make smoke_report
-
-To upload the report anonymously. Hopefully that'll return something
-like "Reported #7 added.".
-
-If you're going to be uploading reports frequently please request a
-user account by E-Mailing gitsmoke@v.nix.is. Once you have a username
-and password you'll be able to do:
-
-    SMOKE_USERNAME=<username> SMOKE_PASSWORD=<password> make smoke_report
-
-You can also add an additional comment to attach to the report, and/or
-a comma separated list of tags:
-
-    SMOKE_USERNAME=<username> SMOKE_PASSWORD=<password> \
-        SMOKE_COMMENT=<comment> SMOKE_TAGS=<tags> \
-        make smoke_report
-
-Once the report is uploaded it'll be made available at
-http://smoke.git.nix.is, here's an overview of Recent Smoke Reports
-for Git:
-
-    http://smoke.git.nix.is/app/projects/smoke_reports/1
-
-The reports will also be mirrored to GitHub every few hours:
-
-    http://github.com/gitsmoke/smoke-reports
-
-The Smolder SQLite database is also mirrored and made available for
-download:
-
-    http://github.com/gitsmoke/smoke-database
-
-Note that the database includes hashed (with crypt()) user passwords
-and E-Mail addresses. Don't use a valuable password for the smoke
-service if you have an account, or an E-Mail address you don't want to
-be publicly known. The user accounts are just meant to be convenient
-labels, they're not meant to be secure.
diff --git a/t/harness b/t/harness
deleted file mode 100755
index f5c02f4..0000000
--- a/t/harness
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use warnings;
-use Getopt::Long ();
-use TAP::Harness::Archive;
-
-Getopt::Long::Parser->new(
-	config => [ qw/ pass_through / ],
-)->getoptions(
-	'jobs:1'    => \(my $jobs = $ENV{TEST_JOBS}),
-	'archive=s' => \my $archive,
-) or die "$0: Couldn't getoptions()";
-
-TAP::Harness::Archive->new({
-	jobs             => $jobs,
-	archive          => $archive,
-	($ENV{GIT_TEST_OPTS}
-	 ? (test_args    => [ split /\s+/, $ENV{GIT_TEST_OPTS} ])
-	 : ()),
-	extra_properties => {},
-})->runtests(@ARGV);
-- 
1.7.7.3

^ permalink raw reply related

* Re: [PATCH] fix shell command line in example
From: Joey Hess @ 2011-12-23 17:33 UTC (permalink / raw)
  To: git
In-Reply-To: <8739cbi5v3.fsf@thomas.inf.ethz.ch>

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

Thomas Rast wrote:
>   * Update the upstream origin of the current branch, then merge the
>     tracked branch into the current one:
>   +
>   --------------------------------------------------
>   $ git pull
>   --------------------------------------------------
> 
> modulo avoiding confusion around upstream/tracking.

I support having a simple "git pull" example; I think it's the first
thing users should be reaching for, followed perhaps by "git pull foo bar"
when they have multiple remotes. 

Still, an example of pulling all tracking branches from a remote and
merging in the right one for the currently checked out branch would be
good to have, that's also a common need when using git without a
centralized origin. AFAICS, there's no way to do all that in a single
git pull command? My feeling was that this sort of scenario was what
the example was trying to do (rather badly).

-- 
see shy jo

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

^ permalink raw reply

* Re: Gitk: shortcut to jump to the current HEAD (yellow spot)?
From: Dirk Süsserott @ 2011-12-23 18:54 UTC (permalink / raw)
  To: Pat Thoyts; +Cc: Git Mailing List
In-Reply-To: <874nwslayi.fsf@fox.patthoyts.tk>

Am 22.12.2011 19:26 schrieb Pat Thoyts:
> Dirk Süsserott <newsletter@dirk.my1.cc> writes:
> 
>> Hi!
>>
>> Does anybody know about a shortcut in gitk to "jump to the yellow spot"?
>>
>> I often use cmdline and gitk at the same time, switch branches, stash,
>> rebase and so on from bash. When hitting [Ctrl-]F5 in gitk, the last
>> highlighted commit is focused again and my HEAD is far off the screen.
>>
>> Is there a way to jump to the HEAD (the yellow bubble in gitk) with a
>> fingertip?
>>
>> TIA
>>    Dirk
> 
> Hit the Home key. The binding for that takes you to the first commit.
> End to the last (oldest) commit.

Hi Pat,

thank you, but I almost always run gitk with the '--all' parameter.
Actually, I have a function in my .bashrc for this:

  # calls gitk from the top-level directory:
  function gkup()
  {
      (cd "./$(git rev-parse --show-cdup)"; gitk --all "$@" &)
  }

That's because gitk behaves odd (at least to me) when not run from the
top-level directory. E.g. the "touching paths" box won't find files in
the top dir if you don't prefix them with a slash. It's all relative to
the directory gitk was started in. To get predictable behavior, I wrote
this function and garnished it with '--all'.

Thus, my current HEAD is not always on the top of the history but
somewhere in between. However, typing "HEAD" (or "head" in the SHA1
field works for me.

Cheers
    Dirk

^ permalink raw reply

* Re: "Nested quantifiers" error in gitweb with "++" in the filename
From: Jehan Bing @ 2011-12-23 19:37 UTC (permalink / raw)
  To: git
In-Reply-To: <CANgJU+VA9s9t0c8D0P_DesbSDQRBQ6v913KixKQAuiy8jZsdzQ@mail.gmail.com>

On 2011-12-23 08:02, demerphq wrote:
> On 22 December 2011 21:37, Jehan Bing<jehan@orb.com>  wrote:
>> Hi,
>>
>> I'm getting an error when trying to look at a blob when the filename has
>> "++" in it:
>>
>> http://.../blob/13ec1624fefc23d20d0407aac3337b35844a2ceb:/foo-++.txt
>
> This error comes because the filename is being used a pattern without
> being protected by a quotemeta.
>
> Interestingly, a later version of perl would not have this problem as
> ++ is a legal quantifier as of 5.10, nevertheless it probably wouldnt
> do what you expected.
>

Interestingly, a later version of perl would not have this problem as, 
after investigating the problem further, it's actually a bug in CGI.pm 
which has since been fixed ;)

My distribution comes with an old version of CGI.pm (3.15 from perl 
5.8.8). After updating to the latest, the problem went away.

^ permalink raw reply

* [RFC PATCH] Allow cloning branches selectively
From: Carlos Martín Nieto @ 2011-12-23 20:13 UTC (permalink / raw)
  To: git

Sometimes it's useful to clone only a subset of branches from a remote
we're cloning. Teach clone the --fetch option to select which branches
should get fetched.

Each --fetch sets up a fetch refspec for that branch. Previously this
was only possible by initializing a repo and manually setting up the
config.
---

This is still a WIP, as clone will still always fetch and checkout the
remote's HEAD, which leaves you with a detached HEAD if you didn't
want that branch, which is clearly a bug.

Otherwise it works as expected. A better name for this feature would
also be nice, as in git you don't clone branches but repos. Maybe
something like "selectively fetch branches on clone"? If there isn't
an outcry against this I'll add --fetch to the manpage as well.

   cmn

 builtin/clone.c          |   82 ++++++++++++++++++++++++++++++++++------------
 t/t5702-clone-options.sh |   22 +++++++++++--
 2 files changed, 80 insertions(+), 24 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 86db954..f14ca2a 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -48,6 +48,17 @@ static int option_verbosity;
 static int option_progress;
 static struct string_list option_config;
 static struct string_list option_reference;
+static struct string_list option_fetch;
+static const char **refspecs;
+static int refspecs_nr;
+static int refspecs_alloc;
+
+static void add_refspec(const char *ref)
+{
+	refspecs_nr++;
+	ALLOC_GROW(refspecs, refspecs_nr, refspecs_alloc);
+	refspecs[refspecs_nr-1] = ref;
+}
 
 static int opt_parse_reference(const struct option *opt, const char *arg, int unset)
 {
@@ -88,6 +99,8 @@ static struct option builtin_clone_options[] = {
 		   "use <name> instead of 'origin' to track upstream"),
 	OPT_STRING('b', "branch", &option_branch, "branch",
 		   "checkout <branch> instead of the remote's HEAD"),
+	OPT_STRING_LIST(0, "fetch", &option_fetch, "refspec",
+		   "fetch <refspec> instead of all the branches"),
 	OPT_STRING('u', "upload-pack", &option_upload_pack, "path",
 		   "path to git-upload-pack on the remote"),
 	OPT_STRING(0, "depth", &option_depth, "depth",
@@ -421,13 +434,16 @@ static void remove_junk_on_signal(int signo)
 }
 
 static struct ref *wanted_peer_refs(const struct ref *refs,
-		struct refspec *refspec)
+		struct refspec *refspec, int refspec_nr)
 {
 	struct ref *head = copy_ref(find_ref_by_name(refs, "HEAD"));
 	struct ref *local_refs = head;
 	struct ref **tail = head ? &head->next : &local_refs;
+	int i;
+
+	for (i = 0; i < refspec_nr; i++)
+		get_fetch_map(refs, &refspec[i], &tail, 0);
 
-	get_fetch_map(refs, refspec, &tail, 0);
 	if (!option_mirror)
 		get_fetch_map(refs, tag_refspec, &tail, 0);
 
@@ -482,7 +498,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	int err = 0;
 
 	struct refspec *refspec;
-	const char *fetch_pattern;
 
 	junk_pid = getpid();
 
@@ -508,6 +523,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		option_no_checkout = 1;
 	}
 
+	if (option_mirror && refspecs)
+		die(_("--mirror and --fetch options are incompatible"));
+
 	if (!option_origin)
 		option_origin = "origin";
 
@@ -594,30 +612,55 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	git_config(git_default_config, NULL);
 
 	if (option_bare) {
-		if (option_mirror)
+		git_config_set("core.bare", "true");
+		if (option_mirror) {
 			src_ref_prefix = "refs/";
-		strbuf_addstr(&branch_top, src_ref_prefix);
+			strbuf_addf(&key, "remote.%s.mirror", option_origin);
+			git_config_set(key.buf, "true");
+			strbuf_reset(&key);
+		}
 
-		git_config_set("core.bare", "true");
+		strbuf_addstr(&branch_top, src_ref_prefix);
 	} else {
 		strbuf_addf(&branch_top, "refs/remotes/%s/", option_origin);
 	}
 
-	strbuf_addf(&value, "+%s*:%s*", src_ref_prefix, branch_top.buf);
+	strbuf_reset(&key);
+	strbuf_addf(&key, "remote.%s.fetch", option_origin);
+
+	/* If the user didn't override it, use the default values */
+	if (option_fetch.nr == 0) {
+		strbuf_reset(&value);
+		strbuf_addf(&value, "+%s*:%s*", src_ref_prefix,
+			    branch_top.buf);
 
-	if (option_mirror || !option_bare) {
-		/* Configure the remote */
-		strbuf_addf(&key, "remote.%s.fetch", option_origin);
 		git_config_set_multivar(key.buf, value.buf, "^$", 0);
-		strbuf_reset(&key);
+		add_refspec(strbuf_detach(&value, NULL));
+	} else {
+		int i;
+		for (i = 0; i < option_fetch.nr; i++) {
+			const char *ref = option_fetch.items[i].string;
+			if (!valid_fetch_refspec(ref))
+				die(_("Not a valid fetch refspec: %s"), ref);
+
+			/* If we only got a branch name, make it a proper refspec */
+			if (!strchr(ref, ':')) {
+				strbuf_reset(&value);
+				strbuf_addf(&value, "refs/heads/%s:%s%s",
+					    ref, branch_top.buf, ref);
+				ref = value.buf;
+			}
 
-		if (option_mirror) {
-			strbuf_addf(&key, "remote.%s.mirror", option_origin);
-			git_config_set(key.buf, "true");
-			strbuf_reset(&key);
+			printf("Adding refpsec %s\n", ref);
+			git_config_set_multivar(key.buf, value.buf, "^$", 0);
+			add_refspec(strbuf_detach(&value, NULL));
 		}
+
+		strbuf_reset(&value);
+		strbuf_reset(&key);
 	}
 
+	strbuf_reset(&key);
 	strbuf_addf(&key, "remote.%s.url", option_origin);
 	git_config_set(key.buf, repo);
 	strbuf_reset(&key);
@@ -625,14 +668,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 	if (option_reference.nr)
 		setup_reference();
 
-	fetch_pattern = value.buf;
-	refspec = parse_fetch_refspec(1, &fetch_pattern);
-
-	strbuf_reset(&value);
+	refspec = parse_fetch_refspec(refspecs_nr, refspecs);
 
 	if (is_local) {
 		refs = clone_local(path, git_dir);
-		mapped_refs = wanted_peer_refs(refs, refspec);
+		mapped_refs = wanted_peer_refs(refs, refspec, refspecs_nr);
 	} else {
 		struct remote *remote = remote_get(option_origin);
 		transport = transport_get(remote, remote->url[0]);
@@ -654,7 +694,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 		refs = transport_get_remote_refs(transport);
 		if (refs) {
-			mapped_refs = wanted_peer_refs(refs, refspec);
+			mapped_refs = wanted_peer_refs(refs, refspec, refspecs_nr);
 			transport_fetch_refs(transport, mapped_refs);
 		}
 	}
diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh
index 02cb024..53d914f 100755
--- a/t/t5702-clone-options.sh
+++ b/t/t5702-clone-options.sh
@@ -8,15 +8,17 @@ test_expect_success 'setup' '
 	mkdir parent &&
 	(cd parent && git init &&
 	 echo one >file && git add file &&
-	 git commit -m one)
+	 git commit -m one &&
+	 git branch other)
 
 '
 
 test_expect_success 'clone -o' '
 
 	git clone -o foo parent clone-o &&
-	(cd clone-o && git rev-parse --verify refs/remotes/foo/master)
-
+	(cd clone-o &&
+	 git rev-parse --verify refs/remotes/foo/master &&
+	 git rev-parse --verify refs/remotes/foo/other)
 '
 
 test_expect_success 'redirected clone' '
@@ -33,4 +35,18 @@ test_expect_success 'redirected clone -v' '
 
 '
 
+test_expect_success 'select one branch to fetch' '
+	git clone --progress --fetch=master "file://$(pwd)/parent" clone-select-one &&
+	(cd clone-sel &&
+	 git rev-parse --verify refs/remotes/origin/master &&
+	 test_must_fail git rev-parse --verify refs/remotes/origin/other)
+'
+
+test_expect_success 'select several branches to fetch' '
+	git clone --progress --fetch=master --fetch=other "file://$(pwd)/parent" clone-select-many &&
+	(cd clone-sel2 &&
+	 git rev-parse --verify refs/remotes/origin/master &&
+	 git rev-parse --verify refs/remotes/origin/other)
+'
+
 test_done
-- 
1.7.8.352.g876a6f

^ permalink raw reply related


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