* Re: Deciding between Git/Mercurial
From: Leo Razoumov @ 2009-09-30 0:49 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Anteru, git
In-Reply-To: <200909292058.53045.jnareb@gmail.com>
On 2009-09-29, Jakub Narebski <jnareb@gmail.com> wrote:
> On Tue, 29 Sep 2009, Leo Razoumov wrote:
> > On 2009-09-28, Jakub Narebski <jnareb@gmail.com> wrote:
> > > [..snip..]
> > > Besides with nonlinear history with
> > > revision numbers such as 12678 and 12687 you know that 12678 is older
> > > than 12687 if and only if 12678 and 12687 are on the same line of
> > > development.
> >
> > The statement above is incorrect!! In a Mercurial repo local revision
> > numbers are strictly ordered in commit time. 12678 < 12687 means that
> > 12678 was committed prior to 12687. But these two commits could belong
> > to two completely unrelated lines of development.
>
>
> This is impossible with distributed development. If the second branch
> comes from other repository, with commits _created_ (in that repository)
> earlier than commits in current repository, but commits in first
> branch (from current repository) were created earlier than _fetching_
> those commits in second branch:
>
> .---.---.---.---x---1---2---3---M---.
> \ /
> \-A---B---C-/ <-- from repository B
>
>
> Either you would have to change commits numbers, and therefore they would
> be not stable, or you would have to change commit time to mean 'time this
> commit got into current repository', which would kill performance for sure.
>
Jakub,
in Mercurial sequential commit numbers are local to a repo and are not
unique between the clones. Unique ID is SHA1 as in git. So mercurial
commit 127:aaf123453dfgdfgddd...
means commit number 127 in this repo with SHA1 "aaf123453dfgdfgddd..."
In another clone commit 127 might mean completely different thing.
Sequential commit numbers are strictly for "local convenience".
--Leo--
^ permalink raw reply
* New JGit project history
From: Shawn O. Pearce @ 2009-09-30 0:28 UTC (permalink / raw)
To: egit-dev, git
As the JGit project is moving to eclipse.org (but is retaining
its current BSD license) we have to start the project history all
over again. The Eclipse Foundation won't permit the project to
host the older LGPL history before our switch to the BSD license,
so we have had to filter it out.
I have posted the new JGit history for the new eclipse.org based
repository to the existing repo.or.cz/jgit repository, in the
branch eclipse.org-post.
In theory, you can migrate a topic branch that is a still in progress
by rebasing with the proper split points:
git rebase -m --onto origin/eclipse.org-post origin/eclipse.org-pre
A complication is the packages were renamed from 'org.spearce' to
'org.eclipse', which means the rename detection stuff is going to
have some fun trying to perform a merge here, and new source files
will need to be adjusted manually.
In the new history the shell script tools/graft-old-history.sh
can be used to create a graft point to pick up the old history,
for use by data mining history tools like log and blame.
Going forward, all pending contributions should be targeting the
new history, and the new package namespace.
--
Shawn.
^ permalink raw reply
* [PATCH] send-email: fix mutt regex for grouped aliases
From: Felipe Contreras @ 2009-09-30 0:08 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Eric Wong, Felipe Contreras
For example:
alias -group friends foo Foo Bar <foo@bar.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
git-send-email.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 0700d80..ec43a5e 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -401,7 +401,7 @@ my %aliases;
my %parse_alias = (
# multiline formats can be supported in the future
mutt => sub { my $fh = shift; while (<$fh>) {
- if (/^\s*alias\s+(\S+)\s+(.*)$/) {
+ if (/^\s*alias\s+(?:-group\s+\S+\s+)?(\S+)\s+(.*)$/) {
my ($alias, $addr) = ($1, $2);
$addr =~ s/#.*$//; # mutt allows # comments
# commas delimit multiple addresses
--
1.6.5.rc2.1.gec34
^ permalink raw reply related
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 20:47 UTC (permalink / raw)
To: Daniel Stenberg; +Cc: Ben Bennett, Sverre Rabbelier, git
In-Reply-To: <alpine.DEB.2.00.0909292228120.23903@tvnag.unkk.fr>
Daniel Stenberg <daniel@haxx.se> writes:
>> Many tools do in this case, Firefox is one of them.
>
> So what if you had that @ in your password and not in your user
> name?
Then the last @ would still be the separator between the
login/password and the hostname, and looking at the '@' starting from
the right hand side would still work.
The problem is if you have a ":" in your login or password, _then_ it
is ambiguous (but by far less common), but the @ is here to split
something that can have a @ in it (login:pass) and something which
can't (hostname), so there isn't any ambiguity.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Daniel Stenberg @ 2009-09-29 20:38 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Ben Bennett, Sverre Rabbelier, git
In-Reply-To: <vpqws3hpqr1.fsf@bauges.imag.fr>
On Tue, 29 Sep 2009, Matthieu Moy wrote:
>> Exactly. So curl is not "wrong", it just can't work around this user-error.
>
> It may not want work around user-errors, but you can hardly say that
> it _can't_.
It can't work around this error. In theory we could make it GUESS that one of
the @-letters are actually supposed to be %40, but I won't. It could also
guess that @ was accidentally a '2' with alt-gr pressed when using a nordic
keyboard layout. Guessing here is crazy.
> Many tools do in this case, Firefox is one of them.
So what if you had that @ in your password and not in your user name?
> And anyway, trying to connect to email.com@server.com is probably the worst
> thing it can do.
I understand that you're saying that as a git user and someone who's not into
curl and libcurl details, but I'm in the opposite corner mostly and I claim
that isn't at all such a bad outcome from that input. curl has that approach
through-out its entire URL parser. It gets what it needs and then uses the
rest unparsed. That way it is very liberal in what it accepts and it doesn't
reject bad URLs as long as it only can extract the parts it needs.
If curl had a strict parser it would of course bluntly reject that URL at
once.
> At least, it could warn about two @ in the URL and say it can't handle it
It could, sure. But curl has no such strict parser so it accepts all sorts of
various violations.
I don't think this is the proper place to discuss what curl (or libcurl)
should or shouldn't do with given URLs - but you're most welcome to bring your
ideas and patches to the curl project and we can debate their virtues over
there.
--
/ daniel.haxx.se
^ permalink raw reply
* Re: Deciding between Git/Mercurial
From: Matthieu Moy @ 2009-09-29 19:55 UTC (permalink / raw)
To: Jakub Narebski; +Cc: SLONIK.AZ, Anteru, git
In-Reply-To: <200909292058.53045.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
> On Tue, 29 Sep 2009, Leo Razoumov wrote:
>> On 2009-09-28, Jakub Narebski <jnareb@gmail.com> wrote:
>> > [..snip..]
>> > Besides with nonlinear history with
>> > revision numbers such as 12678 and 12687 you know that 12678 is older
>> > than 12687 if and only if 12678 and 12687 are on the same line of
>> > development.
>>
>> The statement above is incorrect!! In a Mercurial repo local revision
>> numbers are strictly ordered in commit time. 12678 < 12687 means that
>> 12678 was committed prior to 12687. But these two commits could belong
>> to two completely unrelated lines of development.
>
> This is impossible with distributed development.
Yes, the accurate statement is (I think): "In a Mercurial repo local
revision numbers are strictly ordered according _the time when the_
_commit entered the repository_" (i.e. the time you did a merge, not
the time the other guy did the commit).
Just tested:
$ hg log
changeset: 3:4d6db21df0cd
tag: tip
parent: 1:31f8406ae59c
parent: 2:33bfb84a5113
user: Matthieu Moy <Matthieu.Moy@imag.fr>
date: Tue Sep 29 21:54:25 2009 +0200
summary: merge
changeset: 2:33bfb84a5113
parent: 0:a508b050e5ae
user: Matthieu Moy <Matthieu.Moy@imag.fr>
date: Tue Sep 29 21:54:02 2009 +0200
summary: in branch bar
changeset: 1:31f8406ae59c
user: Matthieu Moy <Matthieu.Moy@imag.fr>
date: Tue Sep 29 21:54:11 2009 +0200
summary: in branch foo
changeset: 0:a508b050e5ae
user: Matthieu Moy <Matthieu.Moy@imag.fr>
date: Tue Sep 29 21:53:33 2009 +0200
summary: init
Either I have a time machine at home, or changesets 1 was not made
before changeset 2.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: Deciding between Git/Mercurial
From: Jakub Narebski @ 2009-09-29 18:58 UTC (permalink / raw)
To: SLONIK.AZ; +Cc: Anteru, git
In-Reply-To: <ee2a733e0909291144g4b99ab7ay9e63bfac935013aa@mail.gmail.com>
On Tue, 29 Sep 2009, Leo Razoumov wrote:
> On 2009-09-28, Jakub Narebski <jnareb@gmail.com> wrote:
> > [..snip..]
> > Besides with nonlinear history with
> > revision numbers such as 12678 and 12687 you know that 12678 is older
> > than 12687 if and only if 12678 and 12687 are on the same line of
> > development.
>
> The statement above is incorrect!! In a Mercurial repo local revision
> numbers are strictly ordered in commit time. 12678 < 12687 means that
> 12678 was committed prior to 12687. But these two commits could belong
> to two completely unrelated lines of development.
This is impossible with distributed development. If the second branch
comes from other repository, with commits _created_ (in that repository)
earlier than commits in current repository, but commits in first
branch (from current repository) were created earlier than _fetching_
those commits in second branch:
.---.---.---.---x---1---2---3---M---.
\ /
\-A---B---C-/ <-- from repository B
Either you would have to change commits numbers, and therefore they would
be not stable, or you would have to change commit time to mean 'time this
commit got into current repository', which would kill performance for sure.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Ben Bennett @ 2009-09-29 18:55 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Sverre Rabbelier, git
In-Reply-To: <vpqpr99pqle.fsf@bauges.imag.fr>
I will look at it tonight. But my fix would be to automatically escape
the @ symbol when git passes onto curl.
Don't know if this would work easy or not, but it would be something
along the lines of .
https://(USERNAME)@(SERVER_ADDR)
The @ would be the last index of the @ symbol in the URL.
Then somekind of function that escape_username_for_curl.
On Tue, Sep 29, 2009 at 1:12 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> OK, so it seems Git should be fixed to unescape this %40 somewhere,
>> most likely in http_auth_init in http.c, in addition to by fix
>> below.
>
> ... err, no not _in addition_ to it, forget this. There's one @ and
> git finds it correctly.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>
^ permalink raw reply
* Re: Deciding between Git/Mercurial
From: Leo Razoumov @ 2009-09-29 18:44 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Anteru, git
In-Reply-To: <m33a66br69.fsf@localhost.localdomain>
On 2009-09-28, Jakub Narebski <jnareb@gmail.com> wrote:
> [..snip..]
> Besides with nonlinear history with
> revision numbers such as 12678 and 12687 you know that 12678 is older
> than 12687 if and only if 12678 and 12687 are on the same line of
> development.
>
The statement above is incorrect!! In a Mercurial repo local revision
numbers are strictly ordered in commit time. 12678 < 12687 means that
12678 was committed prior to 12687. But these two commits could belong
to two completely unrelated lines of development.
--Leo--
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 18:12 UTC (permalink / raw)
To: Ben Bennett; +Cc: Sverre Rabbelier, git
In-Reply-To: <vpq1vlpr5le.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> OK, so it seems Git should be fixed to unescape this %40 somewhere,
> most likely in http_auth_init in http.c, in addition to by fix
> below.
... err, no not _in addition_ to it, forget this. There's one @ and
git finds it correctly.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 18:09 UTC (permalink / raw)
To: Daniel Stenberg; +Cc: Ben Bennett, Sverre Rabbelier, git
In-Reply-To: <alpine.DEB.2.00.0909291946520.23903@tvnag.unkk.fr>
Daniel Stenberg <daniel@haxx.se> writes:
> On Tue, 29 Sep 2009, Matthieu Moy wrote:
>
>> Unfortunately, it seems the complete URL is passed to curl, and curl
>> is the one doing it wrong. Indeed:
>>
>> $ curl -v https://user@email.com@server.com/path/
>> * getaddrinfo(3) failed for email.com@server.com:443
>
> This is not exactly curl "doing it wrong". This is a user passing in
> something that isn't a URL to the command that asks for a URL to work
> on. The user part cannot legally have a '@' letter in a URL, you must
> encode it.
>
>> In short, you have to use %40 to escape the @, and curl does it this
>> way because the RFC doesn't allow @ in usernames.
>
> Exactly. So curl is not "wrong", it just can't work around this user-error.
It may not want work around user-errors, but you can hardly say that
it _can't_. Many tools do in this case, Firefox is one of them. And
anyway, trying to connect to email.com@server.com is probably the
worst thing it can do.
At least, it could warn about two @ in the URL and say it can't
handle it ...
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 18:03 UTC (permalink / raw)
To: Ben Bennett; +Cc: Sverre Rabbelier, git
In-Reply-To: <970bc7c80909291051q5dff9209u650cee4f84d92fae@mail.gmail.com>
Ben Bennett <benbennett@gmail.com> writes:
> Is it escaping the %40 when passed down? I am getting an error 401 ,
> and checking the server logs , it is passing the %40 to the server in
> the username.
> Running curl from command line , I can connect, but through git , the
> username is getting mangled or I have something screwed up.
OK, so it seems Git should be fixed to unescape this %40 somewhere,
most likely in http_auth_init in http.c, in addition to by fix below.
http://curl.haxx.se/libcurl/c/curl_easy_unescape.html might help. I've
consumed by Git time budget for now, so if anyone else can have a
look ...
>> --- a/http.c
>> +++ b/http.c
>> @@ -281,9 +281,10 @@ static void http_auth_init(const char *url)
>> * "proto://<host>/..."?
>> */
>> cp += 3;
>> - at = strchr(cp, '@');
>> colon = strchr(cp, ':');
>> slash = strchrnul(cp, '/');
>> + for(at = slash-1; *at != '@' && *at != '/'; at--)
>> + continue;
>> if (!at || slash <= at)
>> return; /* No credentials */
>> if (!colon || at <= colon) {
>>
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Daniel Stenberg @ 2009-09-29 17:48 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Ben Bennett, Sverre Rabbelier, git
In-Reply-To: <vpq63b1u1p6.fsf@bauges.imag.fr>
On Tue, 29 Sep 2009, Matthieu Moy wrote:
> Unfortunately, it seems the complete URL is passed to curl, and curl
> is the one doing it wrong. Indeed:
>
> $ curl -v https://user@email.com@server.com/path/
> * getaddrinfo(3) failed for email.com@server.com:443
This is not exactly curl "doing it wrong". This is a user passing in something
that isn't a URL to the command that asks for a URL to work on. The user part
cannot legally have a '@' letter in a URL, you must encode it.
> In short, you have to use %40 to escape the @, and curl does it this way
> because the RFC doesn't allow @ in usernames.
Exactly. So curl is not "wrong", it just can't work around this user-error.
--
/ daniel.haxx.se
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Ben Bennett @ 2009-09-29 17:51 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Sverre Rabbelier, git
In-Reply-To: <vpq63b1u1p6.fsf@bauges.imag.fr>
Is it escaping the %40 when passed down? I am getting an error 401 ,
and checking the server logs , it is passing the %40 to the server in
the username.
Running curl from command line , I can connect, but through git , the
username is getting mangled or I have something screwed up.
I will look at http.c tonight after work, to see if I am messing something up.
Thanks,
Ben
On Tue, Sep 29, 2009 at 11:59 AM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Ben Bennett <benbennett@gmail.com> writes:
>
>> I am attempting to do a https clone. The username is an email address
>> but when I do a clone here is what happens.
>
> Hmm, right, it works with ssh, but not http.
>
> I tried a quick fix like this:
>
> diff --git a/http.c b/http.c
> index 23b2a19..361a6be 100644
> --- a/http.c
> +++ b/http.c
> @@ -281,9 +281,10 @@ static void http_auth_init(const char *url)
> * "proto://<host>/..."?
> */
> cp += 3;
> - at = strchr(cp, '@');
> colon = strchr(cp, ':');
> slash = strchrnul(cp, '/');
> + for(at = slash-1; *at != '@' && *at != '/'; at--)
> + continue;
> if (!at || slash <= at)
> return; /* No credentials */
> if (!colon || at <= colon) {
>
> Unfortunately, it seems the complete URL is passed to curl, and curl
> is the one doing it wrong. Indeed:
>
> $ curl -v https://user@email.com@server.com/path/
> * getaddrinfo(3) failed for email.com@server.com:443
> * Couldn't resolve host 'email.com@server.com'
> * Closing connection #0
> curl: (6) Couldn't resolve host 'email.com@server.com'
>
> Now for the good news:
>
> http://curl.haxx.se/mail/lib-2006-02/0134.html
> http://sourceforge.net/tracker/index.php?func=detail&aid=2826621&group_id=976&atid=100976
>
> In short, you have to use %40 to escape the @, and curl does it this
> way because the RFC doesn't allow @ in usernames.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 16:59 UTC (permalink / raw)
To: Ben Bennett; +Cc: Sverre Rabbelier, git
In-Reply-To: <970bc7c80909290831l59b7fc4at4ec0082f42f3ef87@mail.gmail.com>
Ben Bennett <benbennett@gmail.com> writes:
> I am attempting to do a https clone. The username is an email address
> but when I do a clone here is what happens.
Hmm, right, it works with ssh, but not http.
I tried a quick fix like this:
diff --git a/http.c b/http.c
index 23b2a19..361a6be 100644
--- a/http.c
+++ b/http.c
@@ -281,9 +281,10 @@ static void http_auth_init(const char *url)
* "proto://<host>/..."?
*/
cp += 3;
- at = strchr(cp, '@');
colon = strchr(cp, ':');
slash = strchrnul(cp, '/');
+ for(at = slash-1; *at != '@' && *at != '/'; at--)
+ continue;
if (!at || slash <= at)
return; /* No credentials */
if (!colon || at <= colon) {
Unfortunately, it seems the complete URL is passed to curl, and curl
is the one doing it wrong. Indeed:
$ curl -v https://user@email.com@server.com/path/
* getaddrinfo(3) failed for email.com@server.com:443
* Couldn't resolve host 'email.com@server.com'
* Closing connection #0
curl: (6) Couldn't resolve host 'email.com@server.com'
Now for the good news:
http://curl.haxx.se/mail/lib-2006-02/0134.html
http://sourceforge.net/tracker/index.php?func=detail&aid=2826621&group_id=976&atid=100976
In short, you have to use %40 to escape the @, and curl does it this
way because the RFC doesn't allow @ in usernames.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply related
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 17:07 UTC (permalink / raw)
To: Ben Bennett; +Cc: Sverre Rabbelier, git
In-Reply-To: <vpq63b1u1p6.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> In short, you have to use %40 to escape the @, and curl does it this
> way because the RFC doesn't allow @ in usernames.
I've added a FAQ on the wiki. Feel free to improve:
http://git.or.cz/gitwiki/GitFaq#Myusernamecontainsa.27.40.27.2CIcan.27tclonethroughHTTP.2BAC8-HTTPS
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* [JGIT PATCH] Include description for missing prereqs
From: Sasa Zivkov @ 2009-09-29 14:03 UTC (permalink / raw)
To: Shawn O. Pearce, Robin Rosenberg; +Cc: git, Sasa Zivkov
From: Sasa Zivkov <sasa.zivkov@sap.com>
When throwing MissingBundlePrerequisiteException we
also include the short description, if available, of
each missing object.
This is the fix for the following issue:
http://code.google.com/p/egit/issues/detail?id=25
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
---
.../errors/MissingBundlePrerequisiteException.java | 19 +++++++++++--------
.../jgit/transport/BundleFetchConnection.java | 20 +++++++++++++-------
2 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/org.spearce.jgit/src/org/spearce/jgit/errors/MissingBundlePrerequisiteException.java b/org.spearce.jgit/src/org/spearce/jgit/errors/MissingBundlePrerequisiteException.java
index d2335c1..d90350c 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/errors/MissingBundlePrerequisiteException.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/errors/MissingBundlePrerequisiteException.java
@@ -37,7 +37,7 @@
package org.spearce.jgit.errors;
-import java.util.Collection;
+import java.util.Map;
import org.spearce.jgit.lib.ObjectId;
import org.spearce.jgit.transport.URIish;
@@ -48,12 +48,14 @@
public class MissingBundlePrerequisiteException extends TransportException {
private static final long serialVersionUID = 1L;
- private static String format(final Collection<ObjectId> ids) {
+ private static String format(final Map<ObjectId, String> missingCommits) {
final StringBuilder r = new StringBuilder();
r.append("missing prerequisite commits:");
- for (final ObjectId p : ids) {
+ for (final Map.Entry<ObjectId, String> e : missingCommits.entrySet()) {
r.append("\n ");
- r.append(p.name());
+ r.append(e.getKey().name());
+ if (e.getValue() != null)
+ r.append(" ").append(e.getValue());
}
return r.toString();
}
@@ -63,11 +65,12 @@ private static String format(final Collection<ObjectId> ids) {
*
* @param uri
* URI used for transport
- * @param ids
- * the ids of the base/common object(s) we don't have.
+ * @param missingCommits
+ * the Map of the base/common object(s) we don't have. Keys are
+ * ids of the missing objects and values are short descriptions.
*/
public MissingBundlePrerequisiteException(final URIish uri,
- final Collection<ObjectId> ids) {
- super(uri, format(ids));
+ final Map<ObjectId, String> missingCommits) {
+ super(uri, format(missingCommits));
}
}
diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java
index 14e0c7d..034e158 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/BundleFetchConnection.java
@@ -44,9 +44,10 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.spearce.jgit.errors.MissingBundlePrerequisiteException;
@@ -75,7 +76,7 @@
InputStream bin;
- final Set<ObjectId> prereqs = new HashSet<ObjectId>();
+ final Map<ObjectId, String> prereqs = new HashMap<ObjectId, String>();
private String lockMessage;
@@ -120,7 +121,11 @@ private void readBundleV2() throws IOException {
break;
if (line.charAt(0) == '-') {
- prereqs.add(ObjectId.fromString(line.substring(1, 41)));
+ ObjectId id = ObjectId.fromString(line.substring(1, 41));
+ String shortDesc = null;
+ if (line.length() > 42)
+ shortDesc = line.substring(42);
+ prereqs.put(id, shortDesc);
continue;
}
@@ -199,9 +204,10 @@ private void verifyPrerequisites() throws TransportException {
final RevFlag PREREQ = rw.newFlag("PREREQ");
final RevFlag SEEN = rw.newFlag("SEEN");
- final List<ObjectId> missing = new ArrayList<ObjectId>();
+ final Map<ObjectId, String> missing = new HashMap<ObjectId, String>();
final List<RevObject> commits = new ArrayList<RevObject>();
- for (final ObjectId p : prereqs) {
+ for (final Map.Entry<ObjectId, String> e : prereqs.entrySet()) {
+ ObjectId p = e.getKey();
try {
final RevCommit c = rw.parseCommit(p);
if (!c.has(PREREQ)) {
@@ -209,7 +215,7 @@ private void verifyPrerequisites() throws TransportException {
commits.add(c);
}
} catch (MissingObjectException notFound) {
- missing.add(p);
+ missing.put(p, e.getValue());
} catch (IOException err) {
throw new TransportException(transport.uri, "Cannot read commit "
+ p.name(), err);
@@ -243,7 +249,7 @@ private void verifyPrerequisites() throws TransportException {
if (remaining > 0) {
for (final RevObject o : commits) {
if (!o.has(SEEN))
- missing.add(o);
+ missing.put(o, prereqs.get(o));
}
throw new MissingBundlePrerequisiteException(transport.uri, missing);
}
--
1.6.4.msysgit.0
^ permalink raw reply related
* Re: [PATCH 1/2] builtin-mailinfo.c: check error status from rewind and ftruncate
From: Shawn O. Pearce @ 2009-09-29 16:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <1254206409-13256-1-git-send-email-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> wrote:
> A recent "cut at scissors" implementation rewinds and truncates the output
> file to store the message when it sees a scissors mark, but it did not
> check if these library calls succeeded.
...
> diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
> index d498b1c..3306d9e 100644
> --- a/builtin-mailinfo.c
> +++ b/builtin-mailinfo.c
> @@ -785,8 +785,10 @@ static int handle_commit_msg(struct strbuf *line)
>
> if (use_scissors && is_scissors_line(line)) {
> int i;
> - rewind(cmitmsg);
> - ftruncate(fileno(cmitmsg), 0);
> + if (rewind(cmitmsg))
Uh...
builtin-mailinfo.c: In function 'handle_commit_msg':
builtin-mailinfo.c:788: error: void value not ignored as it ought to be
I think you mean to squash this in, and use fseek instead:
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index 3306d9e..c90cd31 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -785,7 +785,7 @@ static int handle_commit_msg(struct strbuf *line)
if (use_scissors && is_scissors_line(line)) {
int i;
- if (rewind(cmitmsg))
+ if (fseek(cmitmsg, 0L, SEEK_SET))
die_errno("Could not rewind output message file");
if (ftruncate(fileno(cmitmsg), 0))
die_errno("Could not truncate output message file at scissors");
--
Shawn.
^ permalink raw reply related
* Re: [PATCH 7/6 (v4)] support for commit grafts, slight change to general mechanism
From: Shawn O. Pearce @ 2009-09-29 16:34 UTC (permalink / raw)
To: Nick Edelen
Cc: Junio C Hamano, Nicolas Pitre, Johannes Schindelin, Sam Vilain,
Michael J Gruber, Jeff King, Andreas Ericsson, Christian Couder,
git@vger.kernel.org
In-Reply-To: <op.u0xtfzjrtdk399@sirnot.ed.ac.uk>
Nick Edelen <sirnot@gmail.com> wrote:
> Adds support for graft commits in rev-cache (w/ test), and slightly alters
> graft mechanism. Before, parse_commit() checked the graft list on every
> commit. Now register_commit_graft() preemptively loads graft commits into
> memory, and sets a new 'graft' flag in the object. This allows awareness of
> the commits' medical history without searching a (normally private) array upon
> each commit.
...
> diff --git a/builtin-rev-cache.c b/builtin-rev-cache.c
> index 4c1766d..b36bc39 100644
This doesn't apply against ne/rev-cache^, and I don't have the
blobs in my repostiory. So I'm dropping this patch and will wait
for a resend of the series or something...
--
Shawn.
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Ben Bennett @ 2009-09-29 15:31 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Matthieu Moy, git
In-Reply-To: <fabb9a1e0909290732h5119170ew133d906b67e49f99@mail.gmail.com>
I am attempting to do a https clone. The username is an email address
but when I do a clone here is what happens.
Here is what I get , I might be messing up the clone command . btw ,
if i leave switch it to ssh , yes it does resolve the url correctly.
git clone https://benjamin.j.bennett@fooserver.com@fooserver.com/git_repos/main-code.git/
test
Initialized empty Git repository in /home/benjamin/planning_workspace/test/.git/
Password:
error: Couldn't resolve host 'fooserver.com@fooserver.com' while
accessing https://benjamin.j.bennett@fooserver.com@myfooserver.com/git_repos/main-code.git//info/refs
On Tue, Sep 29, 2009 at 9:32 AM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
> Heya,
>
> On Tue, Sep 29, 2009 at 16:30, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
>> The question is which @ is the login/server separator, and which one
>> is included in the login. A quick test with
>
> I think it only makes sense that this would work, since any @ can
> never be part of the server name (since it's not an allowed
> character), so I'm still curious why Ben wants to escape his @.
>
> --
> Cheers,
>
> Sverre Rabbelier
>
^ permalink raw reply
* Re: Compact view of history in gitk
From: Martin Langhoff @ 2009-09-29 15:21 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Yakup Akbay, git
In-Reply-To: <4AC1F88E.7080802@viscovery.net>
On Tue, Sep 29, 2009 at 2:07 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> I think, --simplify-by-decoration comes close, even though it may not be
> 100% what you describe.
That is awesome.
Awesomer would be teaching gitk to expand (un-simplify) parts of it.
Probably a pig of a project to do though :-/
m
--
martin.langhoff@gmail.com
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
^ permalink raw reply
* [PATCH] git-blame.el: Change how blame information is shown.
From: David Kågedal @ 2009-09-29 15:12 UTC (permalink / raw)
To: git
It is more customizable, and uses a line prefix to show the commit.
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
I have only tested this on Emacs 23, so please test it on at least
Emacs 22 and let me know if there are any problems.
Suggestions for the default value of git-blame-prefix-format are also
welcome.
contrib/emacs/git-blame.el | 156 +++++++++++++++++++++++++++++---------------
1 files changed, 102 insertions(+), 54 deletions(-)
diff --git a/contrib/emacs/git-blame.el b/contrib/emacs/git-blame.el
index 4fa70c5..2f25ff4 100644
--- a/contrib/emacs/git-blame.el
+++ b/contrib/emacs/git-blame.el
@@ -80,6 +80,57 @@
(eval-when-compile (require 'cl)) ; to use `push', `pop'
+(defface git-blame-prefix-face
+ '((((background dark)) (:foreground "gray"
+ :background "black"))
+ (((background light)) (:foreground "gray"
+ :background "white"))
+ (t (:weight bold)))
+ "The face used for the hash prefix."
+ :group 'git-blame)
+
+(defgroup git-blame nil
+ "A minor mode showing Git blame information."
+ :group 'git
+ :link '(function-link git-blame-mode))
+
+
+(defcustom git-blame-use-colors t
+ "Use colors to indicate commits in `git-blame-mode'."
+ :type 'boolean
+ :group 'git-blame)
+
+(defcustom git-blame-prefix-format
+ "%h %20A:"
+ "The format of the prefix added to each line in `git-blame'
+mode. The format is passed to `format-spec' with the following format keys:
+
+ %h - the abbreviated hash
+ %H - the full hash
+ %a - the author name
+ %A - the author email
+ %c - the committer name
+ %C - the committer email
+ %s - the commit summary
+"
+ :group 'git-blame)
+
+(defcustom git-blame-mouseover-format
+ "%h %a %A: %s"
+ "The format of the description shown when pointing at a line in
+`git-blame' mode. The format string is passed to `format-spec'
+with the following format keys:
+
+ %h - the abbreviated hash
+ %H - the full hash
+ %a - the author name
+ %A - the author email
+ %c - the committer name
+ %C - the committer email
+ %s - the commit summary
+"
+ :group 'git-blame)
+
(defun git-blame-color-scale (&rest elements)
"Given a list, returns a list of triples formed with each
@@ -302,72 +353,69 @@ See also function `git-blame-mode'."
(src-line (string-to-number (match-string 2)))
(res-line (string-to-number (match-string 3)))
(num-lines (string-to-number (match-string 4))))
- (setq git-blame-current
- (if (string= hash "0000000000000000000000000000000000000000")
- nil
- (git-blame-new-commit
- hash src-line res-line num-lines))))
- (delete-region (point) (match-end 0))
- t)
- ((looking-at "filename \\(.+\\)\n")
- (let ((filename (match-string 1)))
- (git-blame-add-info "filename" filename))
- (delete-region (point) (match-end 0))
+ (delete-region (point) (match-end 0))
+ (setq git-blame-current (list (git-blame-new-commit hash)
+ src-line res-line num-lines)))
t)
((looking-at "\\([a-z-]+\\) \\(.+\\)\n")
(let ((key (match-string 1))
(value (match-string 2)))
- (git-blame-add-info key value))
- (delete-region (point) (match-end 0))
- t)
- ((looking-at "boundary\n")
- (setq git-blame-current nil)
- (delete-region (point) (match-end 0))
+ (delete-region (point) (match-end 0))
+ (git-blame-add-info (car git-blame-current) key value)
+ (when (string= key "filename")
+ (git-blame-create-overlay (car git-blame-current)
+ (caddr git-blame-current)
+ (cadddr git-blame-current))
+ (setq git-blame-current nil)))
t)
(t
nil)))
-(defun git-blame-new-commit (hash src-line res-line num-lines)
+(defun git-blame-new-commit (hash)
+ (with-current-buffer git-blame-file
+ (or (gethash hash git-blame-cache)
+ ;; Assign a random color to each new commit info
+ ;; Take care not to select the same color multiple times
+ (let* ((color (if git-blame-colors
+ (git-blame-random-pop git-blame-colors)
+ git-blame-ancient-color))
+ (info `(,hash (color . ,color))))
+ (puthash hash info git-blame-cache)
+ info))))
+
+(defun git-blame-create-overlay (info start-line num-lines)
(save-excursion
(set-buffer git-blame-file)
- (let ((info (gethash hash git-blame-cache))
- (inhibit-point-motion-hooks t)
+ (let ((inhibit-point-motion-hooks t)
(inhibit-modification-hooks t))
- (when (not info)
- ;; Assign a random color to each new commit info
- ;; Take care not to select the same color multiple times
- (let ((color (if git-blame-colors
- (git-blame-random-pop git-blame-colors)
- git-blame-ancient-color)))
- (setq info (list hash src-line res-line num-lines
- (git-describe-commit hash)
- (cons 'color color))))
- (puthash hash info git-blame-cache))
- (goto-line res-line)
- (while (> num-lines 0)
- (if (get-text-property (point) 'git-blame)
- (forward-line)
- (let* ((start (point))
- (end (progn (forward-line 1) (point)))
- (ovl (make-overlay start end)))
- (push ovl git-blame-overlays)
- (overlay-put ovl 'git-blame info)
- (overlay-put ovl 'help-echo hash)
+ (goto-line start-line)
+ (let* ((start (point))
+ (end (progn (forward-line num-lines) (point)))
+ (ovl (make-overlay start end))
+ (hash (car info))
+ (spec `((?h . ,(substring hash 0 6))
+ (?H . ,hash)
+ (?a . ,(git-blame-get-info info 'author))
+ (?A . ,(git-blame-get-info info 'author-mail))
+ (?c . ,(git-blame-get-info info 'committer))
+ (?C . ,(git-blame-get-info info 'committer-mail))
+ (?s . ,(git-blame-get-info info 'summary)))))
+ (push ovl git-blame-overlays)
+ (overlay-put ovl 'git-blame info)
+ (overlay-put ovl 'help-echo
+ (format-spec git-blame-mouseover-format spec))
+ (if git-blame-use-colors
(overlay-put ovl 'face (list :background
- (cdr (assq 'color (nthcdr 5 info)))))
- ;; the point-entered property doesn't seem to work in overlays
- ;;(overlay-put ovl 'point-entered
- ;; `(lambda (x y) (git-blame-identify ,hash)))
- (let ((modified (buffer-modified-p)))
- (put-text-property (if (= start 1) start (1- start)) (1- end)
- 'point-entered
- `(lambda (x y) (git-blame-identify ,hash)))
- (set-buffer-modified-p modified))))
- (setq num-lines (1- num-lines))))))
-
-(defun git-blame-add-info (key value)
- (if git-blame-current
- (nconc git-blame-current (list (cons (intern key) value)))))
+ (cdr (assq 'color (cdr info))))))
+ (overlay-put ovl 'line-prefix
+ (propertize (format-spec git-blame-prefix-format spec)
+ 'face 'git-blame-prefix-face))))))
+
+(defun git-blame-add-info (info key value)
+ (nconc info (list (cons (intern key) value))))
+
+(defun git-blame-get-info (info key)
+ (cdr (assq key (cdr info))))
(defun git-blame-current-commit ()
(let ((info (get-char-property (point) 'git-blame)))
--
1.6.4.rc3.21.g3b9e
^ permalink raw reply related
* Re: git-diff/git-diff-files: Turn off copy-detection?
From: Miklos Vajna @ 2009-09-29 15:05 UTC (permalink / raw)
To: Marius Storm-Olsen; +Cc: Johannes Sixt, Git Mailing List
In-Reply-To: <4AC218BB.4080807@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 348 bytes --]
On Tue, Sep 29, 2009 at 04:24:59PM +0200, Marius Storm-Olsen <marius@storm-olsen.com> wrote:
> $ git config diff.renames
> copies
>
> That's it, thanks! Strange that nothing in the git-diff documentation
> pointed me in this direction? Obviously I didn't connect the dots
> between 'copy' and 'renames' either..
See man git-config. :)
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Sverre Rabbelier @ 2009-09-29 14:32 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Ben Bennett, git
In-Reply-To: <vpq1vlp962h.fsf@bauges.imag.fr>
Heya,
On Tue, Sep 29, 2009 at 16:30, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> The question is which @ is the login/server separator, and which one
> is included in the login. A quick test with
I think it only makes sense that this would work, since any @ can
never be part of the server name (since it's not an allowed
character), so I'm still curious why Ben wants to escape his @.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: clone from url with email address as username?(escaping @ symbol)
From: Matthieu Moy @ 2009-09-29 14:30 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Ben Bennett, git
In-Reply-To: <fabb9a1e0909290725w616c3ea9vcb1d2c53950f7788@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
> Heya,
>
> On Tue, Sep 29, 2009 at 16:20, Ben Bennett <benbennett@gmail.com> wrote:
>> Is there any escape sequence for the @ symbol when cloning?
>
> I thought @ is not allowed to be in an url? What do you need to
> escape it for?
If your username is "foo@bar.com", then the clone URL might well be
ssh://foo@bar.com@server.com/path/to/repo
The question is which @ is the login/server separator, and which one
is included in the login. A quick test with
git clone ssh://foo@bar.com@localhost/path/to/repo
shows me that Git does the right thing, i.e. uses "foo@bar.com" as the
login, without the need to escape it.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox