Git development
 help / color / mirror / Atom feed
* Re: Features ask for git-send-email
From: David Woodhouse @ 2006-05-02 12:36 UTC (permalink / raw)
  To: Bertrand Jacquin; +Cc: Git Mailing List
In-Reply-To: <4fb292fa0604290630r19edd7ejf88642e33b350d1d@mail.gmail.com>

On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
> Could it be possible to add a features in git-send-email.perl to
> accept a differrent charset as iso-8859-1 ? I would like to send
> fr_FR.utf8 mail as I use git to manager a latex files tree which are
> written in utf8.
> 
> Any objection ?

Seems reasonable. I think we just forgot to include the Content-Type:
header. This fixes it...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..1df75f5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -37,7 +37,7 @@ # Constants (essentially)
 my $compose_filename = ".msg.$$";
 
 # Variables we fill in automatically, or via prompting:
-my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time,$charset);
 
 # Behavior modification variables
 my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
@@ -58,6 +58,7 @@ my $rc = GetOptions("from=s" => \$from,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
 		    "compose" => \$compose,
+		    "charset=s" => \$charset,
 		    "quiet" => \$quiet,
 		    "suppress-from" => \$suppress_from,
 		    "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
@@ -135,6 +136,10 @@ if (!defined $smtp_server) {
 	$smtp_server = "localhost";
 }
 
+if (!defined $charset) {
+	$charset = "UTF-8";
+}
+
 if ($compose) {
 	# Note that this does not need to be secure, but we will make a small
 	# effort to have it be unique
@@ -214,6 +219,9 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
+   --charset      Specify a character set, if legacy character sets are
+                  used in change logs instead of UTF-8.
+
    --compose      Use \$EDITOR to edit an introductory message for the
                   patch series.
 
@@ -299,6 +307,7 @@ Subject: $subject
 Reply-To: $from
 Date: $date
 Message-Id: $message_id
+Content-Type: text/plain; charset=$charset
 X-Mailer: git-send-email @@GIT_VERSION@@
 ";
 	$header .= "In-Reply-To: $reply_to\n" if $reply_to;

-- 
dwmw2

^ permalink raw reply related

* Re: [PATCH 3/3] fetch: optionally store the current remote information in the config
From: Johannes Schindelin @ 2006-05-02 12:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7v3bfsol9j.fsf@assigned-by-dhcp.cox.net>

Hi,

On Tue, 2 May 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > 	This is what the patch series is all about.
> >
> > 	If there is no interest in a feature like this, let's just forget
> > 	about the whole "remote info in config" thing.
> 
> Well, I took the liberty of adjusting the first one in the
> series and tonight's "pu" has that one and the second one.
> I haven't touched the third one yet, though.

I don't think it is worth introducing yet another way to specify 
short-cuts for remote information, if there is not at least one problem 
which can get solved easier with it than with the other two ways.

> About the second one, I think it probably is a good idea to
> rename the "refspec used for fetch" as Sean suggested earlier.

Okay.

> I do not like that hidden environment variable that sits in the
> command I use everyday, waiting to be triggered to update my
> .config file, possibly by my PEBCAK mistake when I did not want
> it to do so.

I will refactor it.

> I am not quite sure what this bit is about in the second one:
> 
>         sed -n \
>         -e "s/^URL: /remote.$name.url . /p" \
>         -e "s/^Pull: /remote.$name.pull ^$ /p" \
>         -e "s/^Push: /remote.$name.push ^$ /p" \
> 	< "$f"

That is obviously wrong. Will fix while refactoring.

> I think easy conversion tool is a good idea, but I would sleep
> better if it is outside of git-fetch/push chain and is available
> elsewhere, perhaps in contrib/ area.

Will do.

> On a slightly related topic, I think my aversion to your "push
> remotes into config" series the last time was primarily because
> I do not trust repo-config.  Reading an already built config
> seems to work OK and I do not worry too much, but I am still
> wary of letting it write.  Typing "git repo-config" in a freshly
> initialized empty repository seems to segfault, which does not
> help my confidence level either.

I fixed this error (see separate patch). This was reintroduced by 
carelessly checking argv[1] for "--list" and "-l", even if argc < 2. I am 
sorry that I did not review that patch.

I tried to make really sure that repo-config works as expected by 
introducing quite a few test cases into t1300, but evidently I forgot to 
check for things that do not usually break, like calling without 
arguments. This is fixed with the patch I just sent out.

This patch also introduces the "--get-regexp" flag to repo-config, which 
makes up for the lacking shell wildcards (you can ask questions like: 
which keys in the config end in "coatl"?).

As for the trust in repo-config writing the config: it is all done by 
calling git_config_set() or git_config_set_multivar(), which you use 
yourself to set core.repositoryformatversion, among other values.

Ciao,
Dscho

^ permalink raw reply

* Re: Features ask for git-send-email
From: Jakub Narebski @ 2006-05-02 12:53 UTC (permalink / raw)
  To: git
In-Reply-To: <1146573417.14059.21.camel@pmac.infradead.org>

David Woodhouse wrote:

> On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
>> Could it be possible to add a features in git-send-email.perl to
>> accept a differrent charset as iso-8859-1 ? I would like to send
>> fr_FR.utf8 mail as I use git to manager a latex files tree which are
>> written in utf8.
>> 
>> Any objection ?
> 
> Seems reasonable. I think we just forgot to include the Content-Type:
> header. This fixes it...

Doesn't 
        Content-Type: text/plain; charset=$charset
header need also
        MIME-Version: 1.0

-- 
Jakub Narebski
Warsaw, Poland

^ permalink raw reply

* Re: Bug in git log
From: Matthias Kestenholz @ 2006-05-02 13:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7virooomve.fsf@assigned-by-dhcp.cox.net>

* Junio C Hamano (junkio@cox.net) wrote:
> [...]
> We used to have a build problem where we forgot to remove
> libgit.a and an old object from the archive was used by
> mistake.  Could you try rm -f libgit.a and rebuild your git to
> see if it helps?
> 

Ok I did that. I also removed all files which were installed by
'make install' and did a complete rebuild and install of the current
master branch. My git version is now 1.3.1.g7464

The "double dash" problem is not a big deal since it only happens
with the deprecated shellscript-version of whatchanged.

Does anyone get some output with the following command? That was the
bug I tried to report (sorry for my bad/convoluted english)

$ git log -- unresolve.c

-- 
:wq

^ permalink raw reply

* Re: Features ask for git-send-email
From: David Woodhouse @ 2006-05-02 14:14 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <e37km0$vav$1@sea.gmane.org>

On Tue, 2006-05-02 at 14:53 +0200, Jakub Narebski wrote:
> Doesn't 
>         Content-Type: text/plain; charset=$charset
> header need also
>         MIME-Version: 1.0 

Maybe. The use of Content-Type: actually predates RFC2045, and if we
include a MIME-Version header then we should make 100% sure that we also
conform to the rest of RFC2045, which I hadn't actually looked at. In
particular, we should take care of Content-Transfer-Encoding.

I'd prefer to leave MIME-Version out for now, I think.

-- 
dwmw2

^ permalink raw reply

* [PATCH] repo-config: trim white-space before comment
From: Johannes Schindelin @ 2006-05-02 14:58 UTC (permalink / raw)
  To: git, junkio


Earlier, calling

	git-repo-config core.hello

on a .git/config like this:

	[core]
		hello = world ; a comment

would yield "world " (i.e. with a trailing space).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	I wrote:
	> Strange thing I realized: A value is white-space-trimmed at the end
	> only if the line does not end with a comment. This fact is accounted
	> for in the new tests.

	It actually was a buglet in parse_value(), so it was not only 
	repo-config which was affected.

	Obviously, this patch comes on top of the --get-regexp patch, but
	feel free to apply without that.

 config.c               |   12 ++++++------
 t/t1300-repo-config.sh |    8 ++++++--
 2 files changed, 12 insertions(+), 8 deletions(-)

bb874fdd7a55b7adc229ee9eb1b59e5852b41594
diff --git a/config.c b/config.c
index 4e1f0c2..253c48a 100644
--- a/config.c
+++ b/config.c
@@ -60,6 +60,12 @@ static char *parse_value(void)
 			space = 1;
 			continue;
 		}
+		if (!quote) {
+			if (c == ';' || c == '#') {
+				comment = 1;
+				continue;
+			}
+		}
 		if (space) {
 			if (len)
 				value[len++] = ' ';
@@ -93,12 +99,6 @@ static char *parse_value(void)
 			quote = 1-quote;
 			continue;
 		}
-		if (!quote) {
-			if (c == ';' || c == '#') {
-				comment = 1;
-				continue;
-			}
-		}
 		value[len++] = c;
 	}
 }
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 52e8e33..e3ab661 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -247,8 +247,12 @@ EOF
 
 test_expect_success 'hierarchical section value' 'cmp .git/config expect'
 
+value="$(git-repo-config beta.noindent)"
+
+test_expect_success 'trim before comment' "test \"$value\" = sillyValue"
+
 cat > expect << EOF
-beta.noindent=sillyValue 
+beta.noindent=sillyValue
 nextsection.nonewline=wow2 for me
 123456.a123=987
 1.2.3.alpha=beta
@@ -258,7 +262,7 @@ test_expect_success 'working --list' \
 	'git-repo-config --list > output && cmp output expect'
 
 cat > expect << EOF
-beta.noindent sillyValue 
+beta.noindent sillyValue
 nextsection.nonewline wow2 for me
 EOF
 
-- 
1.3.1.g259f

^ permalink raw reply related

* Re: Bug in git log
From: Linus Torvalds @ 2006-05-02 15:26 UTC (permalink / raw)
  To: Matthias Kestenholz; +Cc: Junio C Hamano, git
In-Reply-To: <20060502134158.GC4592@spinlock.ch>



On Tue, 2 May 2006, Matthias Kestenholz wrote:
> 
> The "double dash" problem is not a big deal since it only happens
> with the deprecated shellscript-version of whatchanged.

Simple enough to fix. Appended.

The problem was that "git-rev-parse --no-flags --no-revs" will show _just_ 
the filenames from the argument list. That means that it will also remove 
the "--" from the original. That's all well and proper, but 
git-whatchanged had a bug, and it wouldn't separate the filename arguments 
from the flags by adding its own "--".

That bug didn't matter back when we didn't check the parsing all that 
carefully. It does now.

> Does anyone get some output with the following command? That was the
> bug I tried to report (sorry for my bad/convoluted english)
> 
> $ git log -- unresolve.c

Now, this returns empty, and it actually does that for a reason.

Along the main path, "unresolve.c" has never existed. The modern 
"git-whatchanged" (and "git log") is a bit different from the old 
big-whatchanged.

The old git-whatchanged would go through _every_ commit, because it 
literally did

	git-rev-list | git-diff-tree --stdin -- <paths>

and thus the revision list was generated without _any_ regard for the 
paths - and every single commit shows up, whether it is relevant or not.

The new revision is based on the revision parsing thing, and the semantics 
are a bit different: it semantically does the equivalent of

	git-rev-list <paths> | git-diff-tree --stdin -- <paths>

which limits the revision list too on the paths.

And yes, "git log" does the same.

See the discussion a few weeks ago about "path limiting broken", and my 
patch that suggested a "--no-prune-merges" flag:

	http://www.gelato.unsw.edu.au/archives/git/0604/19180.html

which gives more of an explanation.

		Linus

--
diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index 1fb9feb..bb73cff 100755
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
@@ -24,5 +24,5 @@ rev_list_args=$(git-rev-parse --sq --def
 diff_tree_args=$(git-rev-parse --sq --no-revs --no-flags "$@") &&
 
 eval "git-rev-list $count $rev_list_args" |
-eval "git-diff-tree --stdin --pretty -r $diff_tree_flags $diff_tree_args" |
+eval "git-diff-tree --stdin --pretty -r $diff_tree_flags -- $diff_tree_args" |
 LESS="$LESS -S" ${PAGER:-less}

^ permalink raw reply related

* Re: Features ask for git-send-email
From: Jakub Narebski @ 2006-05-02 15:35 UTC (permalink / raw)
  To: git
In-Reply-To: <1146579255.17934.8.camel@pmac.infradead.org>

David Woodhouse wrote:

> On Tue, 2006-05-02 at 14:53 +0200, Jakub Narebski wrote:
>> Doesn't
>>         Content-Type: text/plain; charset=$charset
>> header need also
>>         MIME-Version: 1.0
> 
> Maybe. The use of Content-Type: actually predates RFC2045, and if we
> include a MIME-Version header then we should make 100% sure that we also
> conform to the rest of RFC2045, which I hadn't actually looked at. In
> particular, we should take care of Content-Transfer-Encoding.
> 
> I'd prefer to leave MIME-Version out for now, I think.

If I remember correctly _some_ mail applications or news (Usenet) agents 
did not respect Content-Type without MIME-Version, I think according to 
standard. Perhaps that have changed.

As to the other MIME header:
        Content-Transfer-Encoding: 8bit

-- 
Jakub Narebski
Warsaw, Poland

^ permalink raw reply

* Re: [PATCH] built-in "git grep" (git grip).
From: Junio C Hamano @ 2006-05-02 19:07 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <e378fs$lpc$1@sea.gmane.org>

Jakub Narebski <jnareb@gmail.com> writes:

>> I renamed "git grip" to "git grep" and "git diffn" to "git diff"
>> both in "next" branch to avoid confusion.  Thanks Andreas,
>> Jakub, and others for input.
>
> So, is there a way to use old, script version of those commands?

I'd say that is probably not the real question you wanted to
ask, but let's pretend it is for a moment.

The "master" branch has not been updated to remove the script
one, so you can keep running "master" one (or 1.3.X series).  Or
you can fork your own private edition by tweaking git.c (prevent
it from running the builtin one) and Makefile (resurrect the
script based one and prevent it from installing git-grep
hardlinked with git itself).  One thing that I will not do in
the long run, however, is to keep the script based one and have
builtin one.  It is like carrying all the earlier slightly
incompatible versions as git-grep-1.1.sh, git-grep-1.2.sh, and
git-grep-1.3.sh in the source for fear of backward compatibility
problems -- it is crazy.

So the real question, is what are still missing in the built-in
implementation.  What will we lose if we remove the script based
one and replace it with today's built-in one, if we are ready to
do it today, and if not what we are going to do about them.  My
answer to the latter questions are "not yet" (obviously, that is
why "master" does not have it yet), and "will support what are
reasonable".

Here are main differences that I am aware of:

 - The shell-script one, if you use GNU grep, accepts more
   options to grep than what the current built-in one supports.
   Notable ones that are missing: fixed strings (-F), patterns
   from file (-f), count matches (-c), omit filenames (-h),
   skipping binary files (-I, -U), files without match (-L),
   pcre (-P), silent (-q), word expression (-w), NUL (-z).  They
   should be easy to add if somebody cares enough, and I plan to
   do a few myself before pushing it out to "master".

 - The shell-script one can be coaxed to use different "grep"
   implementation from the standard one with an appropriate PATH
   settings.

At the lowest level, buitlin-grep.c::grep_buffer() function is
called with the set of parsed options, the "filename" used for
reporting, and the text to grepped in-core.  The shell-script
one always worked on working tree files, but the built-in one
can work on working tree files and also alternatively on files
from other versions.  Regardless of where the file comes from,
this function is called to look for the pattern the user is
looking for.

You can do two things.

One is to add support for commonly used but still missing
features to built-in one.  For this, you would need to extend
"struct grep_opt" to hold new option parameters (e.g. if you
want to do "-f", you would need to hold all patterns you obtain
from the named file so grep_buffer() can use them -- currently
it supports only one pattern), and teach grep_buffer() how to do
the new feature.

Another thing you can do is to detect GIT_EXTERNAL_GREP (in the
same spirit as GIT_EXTERNAL_DIFF) environment variable at the
front of grep_buffer(), and when it is set, spawn the named
external program with the original parameters the user supplied,
probably stashed away in "struct grep_opt" when cmd_grep() does
its parameter parsing, and feed it the contents of the buffer.

^ permalink raw reply

* Re: git-bisect broken in 1.2.4
From: Johannes Schindelin @ 2006-05-02 19:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vslnskzjj.fsf@assigned-by-dhcp.cox.net>

Hi

On Tue, 2 May 2006, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Why not just use the existing method:
> >
> > 	[core]
> > 		onlyusesymrefs = false
> 
> USE_SYMLINK_HEAD is not enabled by default, and when it is, it
> _defaults_ to use symlink head.

Okay. I missed the part that support is disabled by default.

Sorry for the noise,
Dscho

^ permalink raw reply

* Re: [PATCH] built-in "git grep" (git grip).
From: Linus Torvalds @ 2006-05-02 21:23 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jakub Narebski, git
In-Reply-To: <7v1wvcmejr.fsf@assigned-by-dhcp.cox.net>



On Tue, 2 May 2006, Junio C Hamano wrote:
> 
>  - The shell-script one, if you use GNU grep, accepts more
>    options to grep than what the current built-in one supports.
>    Notable ones that are missing: fixed strings (-F), patterns
>    from file (-f), count matches (-c), omit filenames (-h),
>    skipping binary files (-I, -U), files without match (-L),
>    pcre (-P), silent (-q), word expression (-w), NUL (-z).  They
>    should be easy to add if somebody cares enough, and I plan to
>    do a few myself before pushing it out to "master".

I use "-w" all the time, along with -5 or similar to get context for the 
grep.

		Linus

^ permalink raw reply

* Re: cg-mkpatch use case
From: Martin Langhoff @ 2006-05-02 21:41 UTC (permalink / raw)
  To: Belmar-Letelier; +Cc: git
In-Reply-To: <44570E8E.5070402@itaapy.com>

On 5/2/06, Belmar-Letelier <luis@itaapy.com> wrote:
>    What is the Cogito way to apply the result of "cg-mkpatch"

AFAIK, cg-patch. However, cg-mkpatch appeared before cg-patch, so you
may have a version of Cogito without cg-patch.

> 2. What are the difference between usecases with "cg-mkpatch"
>    and "git-format-patch" ?

If you are familiar with git tools, use them instead of cg tools ;-)

Cg is simpler, so if you have relatively simple needs, or a team with
simple needs that doesn't need to know all the git tricks and
internals, it can be a timesaver. In my team, people start with Cg and
eventually evolve into using more and more of git.

cheers,


martin

^ permalink raw reply

* [PATCH] git-send-email: fix version string to be valid perl
From: Martin Langhoff @ 2006-05-02 21:44 UTC (permalink / raw)
  To: git, junkio; +Cc: Martin Langhoff

This makes git-send-email easier to develop and debug, skipping the need
to `make git-send-email` every time.

---

 git-send-email.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

1f6dd44e0c919196f9c3d5d617a64111004f24e5
diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..2eb4f6c 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -291,6 +291,13 @@ sub send_message
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc);
 	my $date = strftime('%a, %d %b %Y %H:%M:%S %z', localtime($time++));
+	my $gitversion = '@@GIT_VERSION@@';
+	if ($gitversion =~ m/..GIT_VERSION../) {
+	    $gitversion = `git --version`;
+	    chomp $gitversion;
+	    # keep only what's after the last space
+	    $gitversion =~ s/^.* //; 
+	}
 
 	my $header = "From: $from
 To: $to
@@ -299,7 +306,7 @@ Subject: $subject
 Reply-To: $from
 Date: $date
 Message-Id: $message_id
-X-Mailer: git-send-email @@GIT_VERSION@@
+X-Mailer: git-send-email $gitversion
 ";
 	$header .= "In-Reply-To: $reply_to\n" if $reply_to;
 
-- 
1.3.0.rc4.ge6bf-dirty

^ permalink raw reply related

* Re: [PATCH]: Allow misc https cert for git-svnimport
From: Eric Wong @ 2006-05-02 21:44 UTC (permalink / raw)
  To: P. Christeas; +Cc: git, Matthias Urlichs
In-Reply-To: <200604281801.07155.p_christ@hol.gr>

"P. Christeas" <p_christ@hol.gr> wrote:
> Just had to access a server with a broken certificate (self signed), so I 
> added that patch to git-svnimport.

Matthias should know more about git-svnimport than I do :)

I'm not fully up-to-date on how the SVN:: modules work for this, nor do
I know off the top of my head an ssl svn server with a self-signed cert
to test with.  I just copied the ssl stuff off svn-mirror a while ago :)

> --- /usr/bin/git-svnimport	2006-04-13 09:39:39.000000000 +0300
> +++ /home/panos/bin/git-svnimport	2006-04-28 17:55:45.000000000 +0300
> @@ -96,9 +96,14 @@
>  sub conn {
>  	my $self = shift;
>  	my $repo = $self->{'fullrep'};
> -	my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
> +# 	my $auth = SVN::Core::auth_open ([SVN::Client::get_simple_provider,
> +# 			  SVN::Client::get_ssl_server_trust_file_provider,
> +# 			  SVN::Client::get_ssl_server_trust_prompt_provider(\&_trust_callback),
> +# 			  SVN::Client::get_username_provider]);
> +	my $auth = [SVN::Client::get_simple_provider,
>  			  SVN::Client::get_ssl_server_trust_file_provider,
> -			  SVN::Client::get_username_provider]);
> +			  SVN::Client::get_ssl_server_trust_prompt_provider(\&_trust_callback),
> +			  SVN::Client::get_username_provider];
>  	my $s = SVN::Ra->new(url => $repo, auth => $auth);
>  	die "SVN connection to $repo: $!\n" unless defined $s;
>  	$self->{'svn'} = $s;
> @@ -125,6 +130,45 @@
>  	return $name;
>  }
>  
> +sub _trust_callback {
> +	my ($cred,$realm,$ifailed,$server_cert_info,$may_save) = @_;
> +	#$cred->accepted_failures($SVN::Auth::SSL::UNKNOWNCA);
> +	print "SSL certificate is not trusted: $ifailed \n";
> +	print "Fingerprint: " . $server_cert_info->fingerprint . "\n";
> +	print "Hostname:    ". $server_cert_info->hostname ;
> +	print " (MISMATCH)" if ( $ifailed & $SVN::Auth::SSL::CNMISMATCH);
> +	print "\n";
> +	
> +	print "Valid from:  ". $server_cert_info->valid_from;
> +	print " (NOT YET)" if ( $ifailed & $SVN::Auth::SSL::NOTYETVALID);
> +	print "\n";
> +	
> +	print "Valid until: ". $server_cert_info->valid_until;
> +	print " (EXPIRED)" if ( $ifailed & $SVN::Auth::SSL::EXPIRED);
> +	print "\n";
> +	
> +	print "Issuer:      ". $server_cert_info->issuer_dname;
> +	print " (UNKNOWN)" if ( $ifailed & $SVN::Auth::SSL::UNKNOWNCA);
> +	print "\n\n";
> +	
> +	print "Do you still want to accept that certificate? [y/N] ";
> +	my $accept = <STDIN>;
> +	chomp($accept);
> +	print "\n";
> +	if (($accept eq "y") or ($accept eq "Y" )) {
> +		$cred->accepted_failures($ifailed);
> +	# 	print "Save cert, so that it is accepted in future calls? [y/N] ";
> +	# 	my $mmsave = <STDIN>;
> +	# 	chomp($mmsave);
> +	# 	if (($mmsave eq "y") or ($mmsave eq "Y" )) {
> +	# 		$may_save = 1;
> +	# 	}
> +		print "\n";
> +	}
> +
> +}
> +
> +
>  package main;
>  use URI;
>  


-- 
Eric Wong

^ permalink raw reply

* Re: [PATCH] built-in "git grep" (git grip).
From: Junio C Hamano @ 2006-05-02 21:54 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0605021422200.4086@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> On Tue, 2 May 2006, Junio C Hamano wrote:
>> 
>>  - The shell-script one, if you use GNU grep, accepts more
>>    options to grep than what the current built-in one supports.
>>    Notable ones that are missing: fixed strings (-F), patterns
>>    from file (-f), count matches (-c), omit filenames (-h),
>>    skipping binary files (-I, -U), files without match (-L),
>>    pcre (-P), silent (-q), word expression (-w), NUL (-z).  They
>>    should be easy to add if somebody cares enough, and I plan to
>>    do a few myself before pushing it out to "master".
>
> I use "-w" all the time, along with -5 or similar to get context for the 
> grep.

Noted; -w is missing; -A/-B/-C are already there so you could
say -C 5 instead, and -<n> should be easy to add.

On a related tangent, ever since I started using the built-in
grep with ls-files like wildcard, I find myself typing something
like this by mistake (this is from my day-job work project that
has src/mx.js and src/mxstyle.css among other things):

	git diff 268a94 -- 'src/mx*'

I am tempted to suggest switching pathspecs used by diff and log
family to do the same wildcarding, perhaps after tightening the
wildcard vs directory prefix logic used in the builtin-grep of
the current "next" tip, which is a bit looser than necessary.

^ permalink raw reply

* Re: cg-mkpatch use case
From: Petr Baudis @ 2006-05-02 21:57 UTC (permalink / raw)
  To: Belmar-Letelier; +Cc: git
In-Reply-To: <44570E8E.5070402@itaapy.com>

  Hi,

Dear diary, on Tue, May 02, 2006 at 09:47:26AM CEST, I got a letter
where Belmar-Letelier <luis@itaapy.com> said that...
> I have 3 questions about cg-mkpatch
> 
> 1. I've receive a file "xxx.patch", this content came from
>   cg-mkpatch, but I can't apply it.
>   For example if I try git-am I get::
> 
>     $ git-am --signoff xxx.patch
>     Patch does not have a valid e-mail address.
> 
>   What is the Cogito way to apply the result of "cg-mkpatch"

  cg-mkpatch is a very old tool which has been long neglected and
not many people actually use it nowadays, I believe. You can apply it
back using cg-patch (or even patch itself, or git-apply if you are
lucky), but it won't automagically extract the commit message and
authorship information.

> 2. What are the difference between usecases with "cg-mkpatch"
>   and "git-format-patch" ?

  git-format-patch outputs stuff in the mailbox format while cg-mkpatch
outputs it in a more "human readable" (well, but quite historical)
format, but really, you probably want to use git-format-patch in almost
every case. In the (probably relatively near) future, cg-mkpatch might
become merely a git-format-patch wrapper.

> 3. It seem that if a commit as a binary file they are no way to manage
>   it by email patches. Any plan about this in Cogito ?

  Not any clear plans. I will welcome patches but it is not high
priority for me currently.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

^ permalink raw reply

* Re: cg-mkpatch use case
From: Martin Langhoff @ 2006-05-02 22:19 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Belmar-Letelier, git
In-Reply-To: <20060502215703.GK27689@pasky.or.cz>

On 5/3/06, Petr Baudis <pasky@suse.cz> wrote:
> not many people actually use it nowadays, I believe. You can apply it
> back using cg-patch (or even patch itself, or git-apply if you are
> lucky), but it won't automagically extract the commit message and
> authorship information.

Erm... I don't personally use it, but cg-patch --long-help tells me...

-c::
        Automatically extract the commit message and authorship information
        (if provided) from the patch and commit it after applying it
        successfuly.

Truth in advertising? ;-)

cheers,


martin

^ permalink raw reply

* Re: cg-mkpatch use case
From: Petr Baudis @ 2006-05-02 22:34 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Belmar-Letelier, git
In-Reply-To: <46a038f90605021519x5ee680b0v78dd5c092e1b191f@mail.gmail.com>

Dear diary, on Wed, May 03, 2006 at 12:19:00AM CEST, I got a letter
where Martin Langhoff <martin.langhoff@gmail.com> said that...
> On 5/3/06, Petr Baudis <pasky@suse.cz> wrote:
> >not many people actually use it nowadays, I believe. You can apply it
> >back using cg-patch (or even patch itself, or git-apply if you are
> >lucky), but it won't automagically extract the commit message and
> >authorship information.
> 
> Erm... I don't personally use it, but cg-patch --long-help tells me...
> 
> -c::
>        Automatically extract the commit message and authorship information
>        (if provided) from the patch and commit it after applying it
>        successfuly.
> 
> Truth in advertising? ;-)

Uhm, no, it just didn't stick in my mind in the storm of cg-patch
improvements. :-) Oops.

So, YES, there IS a way to apply cg-mkpatches preserving autorship and
everything - cg-patch -c. Sorry for the confusion. ;-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

^ permalink raw reply

* Re: Features ask for git-send-email
From: Bertrand Jacquin @ 2006-05-02 22:46 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Git Mailing List
In-Reply-To: <1146573417.14059.21.camel@pmac.infradead.org>

On 5/2/06, David Woodhouse <dwmw2@infradead.org> wrote:
> On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
> > Could it be possible to add a features in git-send-email.perl to
> > accept a differrent charset as iso-8859-1 ? I would like to send
> > fr_FR.utf8 mail as I use git to manager a latex files tree which are
> > written in utf8.
> >
> > Any objection ?
>
> Seems reasonable. I think we just forgot to include the Content-Type:
> header. This fixes it...

I tryed it. I used this patch again master git git release

And I got the following with git-send-email :

Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
<>: missing or malformed local part
Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
<>: missing or malformed local part

And with my smtp server :

2006-05-03 00:44:01 unexpected disconnection while reading SMTP
command from localhost (localhost.localdomain) [127.0.0.1]

Is it a known bug ? I can't send mail with patch thow :/ I tried to
add Mime-Version: 1.0 too but I got the sam.

--
Beber
#e.fr@freenode

^ permalink raw reply

* Re: [PATCH] built-in "git grep" (git grip).
From: Linus Torvalds @ 2006-05-02 23:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <7vbqugks8j.fsf@assigned-by-dhcp.cox.net>



On Tue, 2 May 2006, Junio C Hamano wrote:
> 
> On a related tangent, ever since I started using the built-in
> grep with ls-files like wildcard, I find myself typing something
> like this by mistake (this is from my day-job work project that
> has src/mx.js and src/mxstyle.css among other things):
> 
> 	git diff 268a94 -- 'src/mx*'
> 
> I am tempted to suggest switching pathspecs used by diff and log
> family to do the same wildcarding, perhaps after tightening the
> wildcard vs directory prefix logic used in the builtin-grep of
> the current "next" tip, which is a bit looser than necessary.

Yeah, the wildcarding is nice. You need to be very careful about it, 
though, to make sure that you take full advantage of the path 
component optimizations _before_ the wildcards, so that when you do 
something like the above ('src/mx*'), you do the "src/" part with the 
tree-level optimizations, and only the latter part with the pattern 
matching (because you do _not_ want to expand the whole tree when you 
don't want to).

That "ls-files.c" thing already does part of this (that whole "prefix_len" 
thing for the "longest common prefix").

		Linus

^ permalink raw reply

* [ANNOUNCE] Git wiki
From: Petr Baudis @ 2006-05-02 23:25 UTC (permalink / raw)
  To: git

  Hi,

  I have just set up a (fairly crude, but hey, it seems to work) wiki at

	http://git.or.cz/gitwiki

  It's slow and ugly but if it becomes popular, I will move it to
something better than Apache CGI. ;-) I also haven't written more than
an introductory paragraph on the front page, the rest is up to you.

  I'm personally not exceptionally fond of wikis (other than Wikipedia)
but a wish to have one has been expressed several times and I hope it
will be helpful for the Git community; not only the newbies might dig
(and especially exchange!) some useful information, tips'n'trick and
such.  Ideally, it could become a melting pot for the Documentation/
directories or the rather austere (I take patches) Git homepage - or
something entirely different. Whatever _you_ make from it.

  Editally yours,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

^ permalink raw reply

* [PATCH] gitweb: Add shorthand URLs for summary and a special html branch
From: Martin Waitz @ 2006-05-02 23:25 UTC (permalink / raw)
  To: git

gitweb now supports URLs like .../gitweb.cgi/<projectpath> as a shortcut
for the project summary page and .../gitweb.cgi/<projectpath>/<file.html>
to access .html pages in an "html" branch.

Signed-off-by: Martin Waitz <tali@admingilde.org>

---

 gitweb.cgi |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 56 insertions(+), 4 deletions(-)

05d0376478ccc273d12dbe177cf11c62c86ab848
diff --git a/gitweb.cgi b/gitweb.cgi
index c1bb624..959ca3e 100755
--- a/gitweb.cgi
+++ b/gitweb.cgi
@@ -20,6 +20,7 @@ my $cgi = new CGI;
 my $version =		"264";
 my $my_url =		$cgi->url();
 my $my_uri =		$cgi->url(-absolute => 1);
+my $my_path =		$cgi->url(-path => 1);
 my $rss_link =		"";
 
 # absolute fs-path which will be prepended to the project path
@@ -42,8 +43,30 @@ # source of projects list
 #my $projects_list =	$projectroot;
 my $projects_list =	"index/index.aux";
 
+
+my ($action, $project, $file_name, $hash);
+
+# rewrite to support direct access to .html files in the "html" branch
+if ($my_path =~ /^$my_url\/(.*\.git)\/?$/) {
+	$action = "summary";
+	$project = validate_input($1);
+} elsif ($my_path =~ /^$my_url\/(.*\.git)\/(.*\.html)$/) {
+	$action = "blob_html";
+	$project = validate_input($1);
+	$file_name = validate_input($2);
+	$hash = "html:$file_name";
+} elsif ($my_path =~ /^$my_url\/(.*\.git)\/(HEAD|objects\/info\/packs|info\/refs|refs\/.*)$/) {
+	$action = "direct_text";
+	$project = validate_input($1);
+	$file_name = validate_input($2);
+} elsif ($my_path =~ /^$my_url\/(.*\.git)\/(objects\/.*)$/) {
+	$action = "direct_object";
+	$project = validate_input($1);
+	$file_name = validate_input($2);
+}
+
 # input validation and dispatch
-my $action = $cgi->param('a');
+$action ||= $cgi->param('a');
 if (defined $action) {
 	if ($action =~ m/[^0-9a-zA-Z\.\-_]/) {
 		undef $action;
@@ -66,7 +89,7 @@ if (defined $order) {
 	}
 }
 
-my $project = $cgi->param('p');
+$project ||= $cgi->param('p');
 if (defined $project) {
 	$project = validate_input($project);
 	if (!defined($project)) {
@@ -88,7 +111,7 @@ if (defined $project) {
 	exit;
 }
 
-my $file_name = $cgi->param('f');
+$file_name ||= $cgi->param('f');
 if (defined $file_name) {
 	$file_name = validate_input($file_name);
 	if (!defined($file_name)) {
@@ -96,7 +119,7 @@ if (defined $file_name) {
 	}
 }
 
-my $hash = $cgi->param('h');
+$hash ||= $cgi->param('h');
 if (defined $hash) {
 	$hash = validate_input($hash);
 	if (!defined($hash)) {
@@ -167,6 +190,9 @@ if (!defined $action || $action eq "summ
 } elsif ($action eq "blob_plain") {
 	git_blob_plain();
 	exit;
+} elsif ($action eq "blob_html") {
+	git_blob_html();
+	exit;
 } elsif ($action eq "tree") {
 	git_tree();
 	exit;
@@ -203,6 +229,10 @@ if (!defined $action || $action eq "summ
 } elsif ($action eq "tag") {
 	git_tag();
 	exit;
+} elsif ($action eq "direct_text") {
+	git_direct_text();
+} elsif ($action eq "direct_object") {
+	git_direct_object();
 } else {
 	undef $action;
 	die_error(undef, "Unknown action.");
@@ -1423,6 +1453,28 @@ sub git_blob_plain {
 	close $fd;
 }
 
+sub git_blob_html {
+	my $save_as = "$hash";
+	if (defined $file_name) {
+		$save_as = $file_name;
+	}
+	print $cgi->header(-type => "text/html", -charset => 'utf-8', '-content-disposition' => "inline; filename=\"$save_as\"");
+	open my $fd, "-|", "$gitbin/git-cat-file blob $hash" or return;
+	undef $/;
+	print <$fd>;
+	$/ = "\n";
+	close $fd;
+}
+
+sub git_direct_text {
+	print $cgi->header(-type => "test/plain");
+	exec("cat", "$projectroot/$project/$file_name");
+}
+sub git_direct_object {
+	print $cgi->header(-type => "application/binary", -expires => "+1y");
+	exec("cat", "$projectroot/$project/$file_name");
+}
+
 sub git_tree {
 	if (!defined $hash) {
 		$hash = git_read_head($project);
-- 
1.3.1.g6ef7


-- 
Martin Waitz

^ permalink raw reply related

* Re: [PATCH] cache-tree: replace a sscanf() by two strtol() calls
From: Junio C Hamano @ 2006-05-02 23:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0605020327400.31493@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> On one of my systems, sscanf() first calls strlen() on the buffer. But
> this buffer is not terminated by NUL. So git crashed.

Interesting.

"git grep sscanf next -- '*.c'" reports handful sscanf() there.
Most of them scan argv[], which are NUL terminated, so they
should be OK.  The rest in convert-objects.c, tree-walk.c, and
tree.c all scan the mode bits in tree objects, which will later
have the pathname component terminated with NUL, so that would
also be OK.

But I think your patch is wrong, and makes it ignore cache-tree
structure; I suspect you have two off-by-one errors and are
making buf and size out of sync.

> 	Maybe, a better solution would be to store the integers in 
> 	binary form. But I am not familiar with that part of git, and
> 	further, it would break setups which already have an index
> 	with cache-tree information.

In theory, it is stashed in the extension section of index so we
could define a new extension type, say "TRE2" and store the
information in the new format.  But this is purely a cache used
as optimiation, so we could just say, "make sure to save local
modifications before doing an update, then run 'rm .git/index &&
git-read-tree HEAD' please".

I've applied a fixed up one, but I am actually thinking about
ripping out the whole cache-tree thing and redoing it all in the
index.
 
Currently the index stores set of blobs after flattening the
hierarchical tree structure, losing the original "tree"
information.  We could instead store something that looks like
"ls-tree -t -r" output (plus the toplevel tree information which
"ls-tree -t -r" does not give you).  Just like an update-index
on the path t/t0000-basic.sh invalidates the cache-tree entry
for "" and "t/", we could either invalidate or recompute (I am
inclined to do the former to make things lazy) these "tree"
entries in the index.  This would be more direct way to store
what I am storing in the cache-tree.

Keeping the object names of unchanged subtrees available will
allow us to walk the index and a tree (or two or more trees) in
parallel in various applications.  "diff-index --cached" and
"read-tree -m" extract one entry from tree and index for each
blob, but when we have an up-to-date information for a subtree
in the index, and when that subtree matches the corresponding
subtree in the tree object diff-index or read-tree is reading,
the application can short-cut without reading anything in the
subtree.

^ permalink raw reply

* Re: [PATCH] repo-config: support --get-regexp and fix crash
From: Junio C Hamano @ 2006-05-02 23:30 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0605021422150.7051@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> 	Junio made me aware of a crash, a fix for which was too easy to
> 	merit a separate patch.

Not really.  The fix is clean-and-obvious, and is readily
applicable to "master" without being cooked in "next".  On the
other hand, --get-regexp may or may not be so; by conflating the
two, you are delaying the trivial and useful fix unnecessarily.

I already split the patch and applied the fix on "master", while
keeping the rest in "pu" (sorry, I ran out of patience to test
everything to put it in "next" -- will do so tomorrow).

It is usually a good idea to avoid making an otherwise good
clean patch a hostage to new features (intentionally or
accidentally).

> 	Strange thing I realized: A value is white-space-trimmed at the end
> 	only if the line does not end with a comment. This fact is accounted
> 	for in the new tests.

Thanks - a note like this helps me quite a bit, because I
usually apply e-mailed patches with --whitespace=strip, which
would have destroyed the test, leaving me scratching my head
without such a notice.

^ permalink raw reply

* Re: Features ask for git-send-email
From: David Woodhouse @ 2006-05-02 23:33 UTC (permalink / raw)
  To: Bertrand Jacquin; +Cc: Git Mailing List
In-Reply-To: <4fb292fa0605021546i45c740c4i42c64125b8c560e@mail.gmail.com>

On Wed, 2006-05-03 at 00:46 +0200, Bertrand Jacquin wrote:
> I tryed it. I used this patch again master git git release
> 
> And I got the following with git-send-email :
> 
> Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> <>: missing or malformed local part 

Interesting; it worked for me. Does the same happen _without_ the patch
applied?

-- 
dwmw2

^ 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