Git development
 help / color / mirror / Atom feed
* Re: [PATCH] branch -m: handle no arg properly
From: Tay Ray Chuan @ 2011-11-02 16:17 UTC (permalink / raw)
  To: Stefan Näwe; +Cc: git@vger.kernel.org, Junio C. Hamano
In-Reply-To: <4EB15D20.1060107@atlas-elektronik.com>

On Wed, 02 Nov 2011 16:09:20 +0100
Stefan Näwe <stefan.naewe@atlas-elektronik.com> wrote:

> Am 02.11.2011 16:01, schrieb Tay Ray Chuan:
> > Modify the option parsing heuristic to handle all -m (rename) cases,
> > including the no-arg case. Previously, this "fell through" to the argc
> > <= 2 case.
> > 
> > Add a regression test in t3200-branch.sh while we're at it.
> 
> Great. I just sent a patch for t3200 as well...

Hmm, yeah, printing usage is a good idea.

Popped my change to t3200 as well, yours looks better. :)

-->8--

Subject: [PATCH] branch -m: handle no arg properly

Modify the option parsing heuristic to handle all -m (rename) cases,
including the no-arg case. Previously, this "fell through" to the argc
<= 2 case.

Reported-by: Stefan Näwe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin/branch.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 009b713..51ca6a0 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -719,11 +719,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 	else if (list)
 		return print_ref_list(kinds, detached, verbose, abbrev,
 				      with_commit, argv);
-	else if (rename && (argc == 1))
-		rename_branch(head, argv[0], rename > 1);
-	else if (rename && (argc == 2))
-		rename_branch(argv[0], argv[1], rename > 1);
-	else if (argc <= 2) {
+	else if (rename) {
+		if (argc == 1)
+			rename_branch(head, argv[0], rename > 1);
+		else if (argc == 2)
+			rename_branch(argv[0], argv[1], rename > 1);
+		else
+			usage_with_options(builtin_branch_usage, options);
+	} else if (argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
 			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
 		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
-- 
1.7.7.1.599.g03eec



--
Cheers,
Ray Chuan

^ permalink raw reply related

* [PATCH] t3200: add test case for 'branch -m'
From: Stefan Naewe @ 2011-11-02 15:07 UTC (permalink / raw)
  To: git; +Cc: gitster, Stefan Naewe
In-Reply-To: <4EB153B4.6070404@atlas-elektronik.com>

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
---
 t/t3200-branch.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 2f5eada..3ce31b5 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -75,6 +75,11 @@ test_expect_success \
         git branch l'
 
 test_expect_success \
+    'git branch -m dumps usage' \
+       'test_expect_code 129 git branch -m 2>err &&
+        grep "[Uu]sage: git branch" err'
+
+test_expect_success \
     'git branch -m m m/m should work' \
        'git branch -l m &&
         git branch -m m m/m &&
-- 
1.7.8.rc0.1.gb345ae

^ permalink raw reply related

* Re: [PATCH] branch -m: handle no arg properly
From: Stefan Näwe @ 2011-11-02 15:09 UTC (permalink / raw)
  To: Tay Ray Chuan; +Cc: git@vger.kernel.org, Junio C. Hamano
In-Reply-To: <1320246098-6912-1-git-send-email-rctay89@gmail.com>

Am 02.11.2011 16:01, schrieb Tay Ray Chuan:
> Modify the option parsing heuristic to handle all -m (rename) cases,
> including the no-arg case. Previously, this "fell through" to the argc
> <= 2 case.
> 
> Add a regression test in t3200-branch.sh while we're at it.

Great. I just sent a patch for t3200 as well...

Stefan
-- 
----------------------------------------------------------------
/dev/random says: If At First You Don't Succeed Ignore The Docs...
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"

^ permalink raw reply

* [PATCH] branch -m: handle no arg properly
From: Tay Ray Chuan @ 2011-11-02 15:01 UTC (permalink / raw)
  To: git; +Cc: Stefan Näwe, Junio C. Hamano
In-Reply-To: <4EB153B4.6070404@atlas-elektronik.com>

Modify the option parsing heuristic to handle all -m (rename) cases,
including the no-arg case. Previously, this "fell through" to the argc
<= 2 case.

Add a regression test in t3200-branch.sh while we're at it.

Reported-by: Stefan Näwe <stefan.naewe@atlas-elektronik.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
 builtin/branch.c  |   13 ++++++++-----
 t/t3200-branch.sh |    4 ++++
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/builtin/branch.c b/builtin/branch.c
index 009b713..ebda8e7 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -719,11 +719,14 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 	else if (list)
 		return print_ref_list(kinds, detached, verbose, abbrev,
 				      with_commit, argv);
-	else if (rename && (argc == 1))
-		rename_branch(head, argv[0], rename > 1);
-	else if (rename && (argc == 2))
-		rename_branch(argv[0], argv[1], rename > 1);
-	else if (argc <= 2) {
+	else if (rename) {
+		if (argc == 1)
+			rename_branch(head, argv[0], rename > 1);
+		else if (argc == 2)
+			rename_branch(argv[0], argv[1], rename > 1);
+		else
+			die(_("new branch not specified for -m|--move"));
+	} else if (argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
 			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
 		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 2f5eada..78587fe 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -75,6 +75,10 @@ test_expect_success \
         git branch l'
 
 test_expect_success \
+    'git branch -m with no arg fails' \
+       'test_must_fail git branch -m'
+
+test_expect_success \
     'git branch -m m m/m should work' \
        'git branch -l m &&
         git branch -m m m/m &&
-- 
1.7.7.1.599.g03eec

^ permalink raw reply related

* Re: git-p4: problem with commit 97a21ca50ef8
From: Vitor Antunes @ 2011-11-02 14:43 UTC (permalink / raw)
  To: git
In-Reply-To: <CAOk9v+_xXRGAGWg2L5u=r9qBS=H+ZmdF=TwumSyq7WKf-15okw@mail.gmail.com>

Michael Wookey <michaelwookey <at> gmail.com> writes:
> Of course, I'd love to have git-p4 work seamlessly for this scenario.
> Even Perforce have a KB article on the limitation of the "apple"
> filetype with git-p4:
> 
>   http://kb.perforce.com/article/1417/git-p4
> 
"""
Step 2: Download Git-p4

Recommended version is ermshiperete’s branch, which is available from:

https://github.com/ermshiperete/git-p4

Note: Omit the “git-p4.py25” file, which is an older version that is no longer
needed.
Avoid Kernel.org’s Version of Git-p4

Git’s main source at http://git-scm.com/download and
http://www.kernel.org/pub/software/scm/git/ contains an older version of Git-p4
with limitations that ermshiperete’s branch avoids.
"""

I can almost guess _who_ wrote this KB ;)

But this is really frustrating. Why can't people just cooperate to make sure the
version in the main branch is the latest?


Vitor

^ permalink raw reply

* 'git -m' dumps core
From: Stefan Näwe @ 2011-11-02 14:29 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: Junio C. Hamano

$ /usr/local/git-v1.7.8-rc0/bin/git version
git version 1.7.8.rc0

$ /usr/local/git-v1.7.8-rc0/bin/git branch -m
Speicherzugriffsfehler (core dumped)

$ /usr/local/git-v1.7.8-rc0/bin/git branch --move
Speicherzugriffsfehler (core dumped)

GDB says:

(gdb) bt
#0  0xb74694f3 in strlen () from /lib/i686/cmov/libc.so.6
#1  0x0810f1ad in strbuf_branchname (sb=0xbfb20bbc, name=0x0) at sha1_name.c:873
#2  0x0810f20e in strbuf_check_branch_ref (sb=0xbfb20bbc, name=0x0) at sha1_name.c:882
#3  0x080b516a in validate_new_branchname (name=0x0, ref=0xbfb20bbc, force=0, attr_only=0) at branch.c:142
#4  0x080b550c in create_branch (head=0x94e32ab "master", name=0x0, start_name=0x94e32ab "master", force=0, reflog=0, track=BRANCH_TRACK_REMOTE)
    at branch.c:177
#5  0x0805a8fe in cmd_branch (argc=0, argv=0xbfb215f8, prefix=0x0) at builtin/branch.c:729
#6  0x0804ba29 in handle_internal_command (argc=2, argv=0xbfb215f8) at git.c:308
#7  0x0804bc67 in main (argc=2, argv=0xbfb215f8) at git.c:512


Stefan
-- 
----------------------------------------------------------------
/dev/random says: If ignorance is bliss, you must be ecstatic.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"

^ permalink raw reply

* Re: [RFC/PATCH] http-push: don't always prompt for password (Was Re: [ANNOUNCE] Git 1.7.8.rc0)
From: Michael J Gruber @ 2011-11-02 14:08 UTC (permalink / raw)
  To: Stefan Näwe; +Cc: Junio C Hamano, git@vger.kernel.org, Jeff King
In-Reply-To: <4EB104EA.2040001@atlas-elektronik.com>

Stefan Näwe venit, vidit, dixit 02.11.2011 09:52:
> Am 01.11.2011 19:12, schrieb Junio C Hamano:
>>
>> There are only handful of commits that even remotely touch http related
>> codepath between v1.7.7 and v1.7.8-rc0:
>>
>>   * deba493 http_init: accept separate URL parameter
>>
>>   This could change the URL string given to http_auth_init().
>>
>>   * 070b4dd http: use hostname in credential description
>>
>>   This only changes the prompt string; as far as I understand it, the
>>   condition the password is prompted in the callsites of git_getpass()
>>   has not changed.
>>
>>   * 6cdf022 remote-curl: Fix warning after HTTP failure
>>   * be22d92 http: avoid empty error messages for some curl errors
>>   * 8abc508 http: remove extra newline in error message
>>   * 8d677ed http: retry authentication failures for all http requests
>>   * 28d0c10 remote-curl: don't retry auth failures with dumb protocol
>>
>>   These shouldn't affect anything wrt prompting, unless you are somehow
>>   internally reauthenticating.
>>
>> Could you try reverting deba493 and retest, and then if the behaviour is
>> the same "need ENTER", further revert 070b4dd and retest?
> 
> I did a little more testing.
> This WIP makes it work for me (i.e. "need ENTER" is gone, works with
> and without .netrc, with 'https://host/repo.git' and 
> 'https://user@host...' URL). Needs testing, of course.
> 
> ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
> diff --git a/http.c b/http.c
> index a4bc770..008ad72 100644
> --- a/http.c
> +++ b/http.c
> @@ -279,8 +279,6 @@ static CURL *get_curl_handle(void)
>         curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
>  #endif
> 
> -       init_curl_http_auth(result);
> -
>         if (ssl_cert != NULL)
>                 curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
>         if (has_cert_password())
> @@ -846,7 +844,7 @@ static int http_request(const char *url, void *result, int target, int options)
>                 else if (missing_target(&results))
>                         ret = HTTP_MISSING_TARGET;
>                 else if (results.http_code == 401) {
> -                       if (user_name) {
> +                       if (user_name && user_pass) {
>                                 ret = HTTP_NOAUTH;
>                         } else {
>                                 /*
> @@ -855,7 +853,8 @@ static int http_request(const char *url, void *result, int target, int options)
>                                  * but that is non-portable.  Using git_getpass() can at least be stubbed
>                                  * on other platforms with a different implementation if/when necessary.
>                                  */
> -                               user_name = xstrdup(git_getpass_with_description("Username", description));
> +                               if (!user_name)
> +                                       user_name = xstrdup(git_getpass_with_description("Username", description));
>                                 init_curl_http_auth(slot->curl);
>                                 ret = HTTP_REAUTH;
>                         }
> ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
> 
> 
> Regards,
>   Stefan
Thanks!

Tested-by: Michael J Gruber <git@drmicha.warpmail.net>

More specifically, I ran our test suite (next plus Stefan's patch), and
tested

https://user@host with .netrc and with askpass
https://host with .netrc

The latter fails with askpass because we ask
Password for 'host'
and not
Password for 'user@host'
but that is true both with and without the patch. (I thought we had
changed that, but I guess it's cooking.)

Michael

^ permalink raw reply

* Re: git sticker svg
From: Erik Faye-Lund @ 2011-11-02 12:22 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Junio C Hamano, Jeff King, git
In-Reply-To: <4EB11364.4010004@drmicha.warpmail.net>

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

On Wed, Nov 2, 2011 at 10:54 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Junio C Hamano venit, vidit, dixit 02.11.2011 10:18:
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>>
>>> I do prefer the rotated, vertically stacked +-G though (with + <-> t, -
>>> <-> i, G <-> 3/4-circle with arrow). Good thing we don't have to argue
>>> about an "official" logo...
>>
>> It somehow reminds me of the OGC logo fiasco, though.
>
> :)
>
> While looking up "OGC logo fiasco" certainly was fun, I don't think that
> our msysgit logo, e.g., is prone to wild fantasies' misinterpretation,
> no matter the position, uhm, rotation:
>
> http://code.google.com/p/msysgit/downloads/detail?name=gitlogo.svg
>
> But maybe my fantasy is not wild enough.
>

Since I'm kind of a typography and design geek and I pretty much hate
the execution of current logos I've seen, I thought I'd give it a go
myself ;)

What do you think?

[-- Attachment #2: git-logo.svg --]
[-- Type: image/svg+xml, Size: 3429 bytes --]

^ permalink raw reply

* Re: long fsck time
From: Nguyen Thai Ngoc Duy @ 2011-11-02 12:10 UTC (permalink / raw)
  To: Git Mailing List
In-Reply-To: <CACsJy8D04Hw0_OoV01g2xtNK2d6fmZD_+YNEOR3A8aMUTpG5Lw@mail.gmail.com>

On Wed, Nov 2, 2011 at 7:06 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On git.git
>
> $ /usr/bin/time git fsck
> 333.25user 4.28system 5:37.59elapsed 99%CPU (0avgtext+0avgdata
> 420080maxresident)k
> 0inputs+0outputs (0major+726560minor)pagefaults 0swaps
>
> That's really long time, perhaps we should print progress so users
> know it's still running?


Ahh.. --verbose. Sorry for the noise. Still good to show the number of
checked objects though.
-- 
Duy

^ permalink raw reply

* long fsck time
From: Nguyen Thai Ngoc Duy @ 2011-11-02 12:06 UTC (permalink / raw)
  To: Git Mailing List

On git.git

$ /usr/bin/time git fsck
333.25user 4.28system 5:37.59elapsed 99%CPU (0avgtext+0avgdata
420080maxresident)k
0inputs+0outputs (0major+726560minor)pagefaults 0swaps

That's really long time, perhaps we should print progress so users
know it's still running?
-- 
Duy

^ permalink raw reply

* Re: [git patches] libata updates, GPG signed (but see admin notes)
From: Jochen Striepe @ 2011-11-02 11:20 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Linus Torvalds, Junio C Hamano, H. Peter Anvin, git,
	James Bottomley, Jeff Garzik, Andrew Morton, linux-ide, LKML
In-Reply-To: <20111102091126.GG18903@elte.hu>

	Hi,

On Wed, Nov 02, 2011 at 10:11:26AM +0100, Ingo Molnar wrote:
> If this approach is used then it would be nice to have a .gitconfig 
> switch to require trusted pulls by default: to not allow doing 
> non-signed or untrusted pulls accidentally, or for Git to warn in a 
> visible, hard to miss way if there's a non-signed pull.
> 
> This adds social uncertainty (and an element of a silent alarm) to a 
> realistic attack: the attacker wouldnt know exactly how the puller 
> checks signed pull requests, it's kept private.

But that way you get a false sense of alarm when someone sent a
perfectly trustable pull request, e.g. by signed email.


Another question: If store the actual pgp/gpg signatures in the git tree,
how do you handle signatures by keys which were valid by the time the
signature was made but expired when checking some time afterwards? AFAICT,
gpg will only tell you the key is expired _now_, and will make no statement
regarding the time the actual signature was made.


Thanks,
Jochen.

^ permalink raw reply

* Re: [git patches] libata updates, GPG signed (but see admin notes)
From: Michael J Gruber @ 2011-11-02 10:53 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Linus Torvalds, git, James Bottomley, Jeff Garzik, Andrew Morton,
	linux-ide, LKML
In-Reply-To: <7vwrbjlj5r.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 01.11.2011 20:47:
> Linus Torvalds <torvalds@linux-foundation.org> writes:
> 
>> But what would be nice is that "git pull" would fetch the tag (based on
>> name) *automatically*, and not actually create a tag in my repository at
>> all. Instead, if would use the tag to check the signature, and - if we
>> do this right - also use the tag contents to populate the merge commit
>> message.
>>
>> In other words, no actual tag would ever be left around as a turd, it
>> would simply be used as an automatic communication channel between the
>> "git push -s" of the submitter and my subsequent "git pull". Neither
>> side would have to do anything special, and the tag would never show
>> up in any relevant tree (it could even be in a totally separate
>> namespace like "refs/pullmarker/<branchname>" or something).
> 
> While I like the "an ephemeral tag is used only for hop-to-hop
> communication to carry information to be recorded in the resulting
> history" approach, I see a few downsides.
> 
>  * The ephemeral tag needs to stay somewhere under refs/ hierarchy of the
>    lieutenant's tree until you pick it up, even if they are out of the way
>    in refs/pullmarker/$branchname. The next time the same lieutenant makes
>    a pull request, either it will be overwritten or multiple versions of
>    them refs/pullmarker/$branchname/$serial need to be kept.

If we are interested in commit sigs, the easiest tag-based approach is
to name the sig carrying tag by the commit's sha1. Just like the sig is
tied (in)to a commit in Junio's approach, it would be indexed by it. We
can do that now:

git config --global alias.sign '!f() { c=$(git rev-parse "$1") || exit;
shift; git tag -s $@ sigs/$c $c; }; f'

But a different place rather than refs/tags/sigs/<sha1> will be more
appropriate, so that we don't pollute the tag namespace. (Yes, this is
similar to storing them in notes.) tags have a message etc.

With an appropriate refspec, these sigs can be pushed out automatically
(by the lieutenant).

pull-request as in next will list the expected <sha1> at tip.

git pull needs to learn to (fetch and) use refs/<whatever>/<sha1> to
verify that the tip is signed.

git log --show-signature can do the same tricks as with in-commit sigs.

Some things to decide in this approach:
- Should git-pull (pull sigs and) verify by default?
- Should we worry about overwriting existings sigs? We have union-merge
for notes already, and that would be appropriate for sigs. (Yes, our
tags code does verify multiple concatenated sigs.)

The advantage of tags is that they can be added without rewriting the
commit, of course.

Michael

^ permalink raw reply

* [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Mika Fischer @ 2011-11-02 10:45 UTC (permalink / raw)
  To: git; +Cc: Mika Fischer

Previously, when nothing could be read from the connections curl had
open, git would just sleep unconditionally for 50ms. This patch changes
this behavior and instead obtains the recommended timeout and the actual
file descriptors from curl. This should eliminate time spent sleeping when
data could actually be read/written on the socket.

Signed-off-by: Mika Fischer <mika.fischer@zoopnet.de>
---
 http.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/http.c b/http.c
index a4bc770..12180f3 100644
--- a/http.c
+++ b/http.c
@@ -649,6 +649,7 @@ void run_active_slot(struct active_request_slot *slot)
 	fd_set excfds;
 	int max_fd;
 	struct timeval select_timeout;
+	long int curl_timeout;
 	int finished = 0;
 
 	slot->finished = &finished;
@@ -664,14 +665,24 @@ void run_active_slot(struct active_request_slot *slot)
 		}
 
 		if (slot->in_use && !data_received) {
-			max_fd = 0;
+			curl_multi_timeout(curlm, &curl_timeout);
+			if (curl_timeout == 0) {
+				continue;
+			} else if (curl_timeout == -1) {
+				select_timeout.tv_sec  = 0;
+				select_timeout.tv_usec = 50000;
+			} else {
+				select_timeout.tv_sec  =  curl_timeout / 1000;
+				select_timeout.tv_usec = (curl_timeout % 1000) * 1000;
+			}
+
+			max_fd = -1;
 			FD_ZERO(&readfds);
 			FD_ZERO(&writefds);
 			FD_ZERO(&excfds);
-			select_timeout.tv_sec = 0;
-			select_timeout.tv_usec = 50000;
-			select(max_fd, &readfds, &writefds,
-			       &excfds, &select_timeout);
+			curl_multi_fdset(curlm, &readfds, &writefds, &excfds, &max_fd);
+
+			select(max_fd+1, &readfds, &writefds, &excfds, &select_timeout);
 		}
 	}
 #else
-- 
1.7.7.1.489.g1fee

^ permalink raw reply related

* Re: [ANNOUNCE] Git 1.7.8.rc0
From: Michael J Gruber @ 2011-11-02 10:27 UTC (permalink / raw)
  To: Stefan Naewe; +Cc: git, Junio C Hamano, Jeff King
In-Reply-To: <loom.20111101T211624-511@post.gmane.org>

[Re-adding cc's]

Stefan Naewe venit, vidit, dixit 01.11.2011 21:18:
> Stefan Naewe <stefan.naewe <at> gmail.com> writes:
> 
>> Push with https works, if the URL looks e.g. like this:
>>
>>   https://github.com/user/repo.git
>>
>> rather than this
>>
>>   https://user <at> github.com/user/repo.git
>>
>> and having a ~/.netrc like this
>>
>>   machine github.com login user password YouDontWantToKnow
>>
>> If the URL contains 'user@' I get the 'need ENTER' behaviour.
>>
> 
> Another update:
> 
> If I revert deba493 the 'need ENTER' is gone and everything works as above.
> 
> 
> Stefan
> 
I can confirm that (and feel partly responsible given the history of of
deba493). For the record: A simple test looks like

SSH_ASKPASS='' git push -n bitbucket
Password for 'bitbucket.org':

which succeeds with a simple ENTER when you have the (log and) PW in
.netrc for that host, and your config says https://user@host.

The workaround is to remove 'user@' from the url in gitconfig, it is not
needed nor used, probably: I haven't checked yet, but that would mean we
can't have two different logins on the same server in .netrc. Can we?

I'll try to have a look later, too.

Michael

^ permalink raw reply

* Re: git sticker svg
From: Michael J Gruber @ 2011-11-02  9:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, git
In-Reply-To: <7vy5vykhl3.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 02.11.2011 10:18:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> I do prefer the rotated, vertically stacked +-G though (with + <-> t, -
>> <-> i, G <-> 3/4-circle with arrow). Good thing we don't have to argue
>> about an "official" logo...
> 
> It somehow reminds me of the OGC logo fiasco, though.

:)

While looking up "OGC logo fiasco" certainly was fun, I don't think that
our msysgit logo, e.g., is prone to wild fantasies' misinterpretation,
no matter the position, uhm, rotation:

http://code.google.com/p/msysgit/downloads/detail?name=gitlogo.svg

But maybe my fantasy is not wild enough.

Michael

^ permalink raw reply

* Re: Q: "git diff" using tag names
From: Junio C Hamano @ 2011-11-02  9:35 UTC (permalink / raw)
  To: Alexey Shumkin; +Cc: Ulrich Windl, git
In-Reply-To: <20111102132945.582707aa@ashu.dyn.rarus.ru>

Alexey Shumkin <alex.crezoff@gmail.com> writes:

>> Also it seems that both syntaxes work:
>> git diff v0.4..v0.5
>> git diff v0.4 v0.5
> honestly, I do not know the difference (at the moment :))
> may be gurus or manual will help to discover it

The latter is the kosher version, as diff is about two "endpoints" and not
about "ranges". The only reason the former is parsed without erroring out
is because too many people are used to type .. between two things without
thinking, learned the notation from "git log", which _is_ about ranges.

^ permalink raw reply

* Re: Q: "git diff" using tag names
From: Frans Klaver @ 2011-11-02  9:34 UTC (permalink / raw)
  To: Alexey Shumkin; +Cc: Ulrich Windl, git
In-Reply-To: <20111102132945.582707aa@ashu.dyn.rarus.ru>

On Wed, Nov 2, 2011 at 10:29 AM, Alexey Shumkin <alex.crezoff@gmail.com> wrote:

>> Also it seems that both syntaxes work:
>> git diff v0.4..v0.5
>> git diff v0.4 v0.5
> honestly, I do not know the difference (at the moment :))
> may be gurus or manual will help to discover it

As per the git-diff documentation, these two versions behave equally
-- i.e. no differences.

Comparing branches
$ git diff topic master    <1>
$ git diff topic..master   <2>
$ git diff topic...master  <3>
‪1.‬ Changes between the tips of the topic and the master branches.
‪2.‬ Same as above.
‪3.‬ Changes that occurred on the master branch since when the topic
branch was started off it.

Cheers,
Frans

^ permalink raw reply

* Re: Q: "git diff" using tag names
From: Alexey Shumkin @ 2011-11-02  9:29 UTC (permalink / raw)
  To: Ulrich Windl; +Cc: git
In-Reply-To: <4EB0FFCA020000A100007DE2@gwsmtp1.uni-regensburg.de>

> Hello Alexey,
> 
> thank you very much for your reply. I felt I did something wrong, but
> couldn't find out what it was. Actually it turned out that I had just
> mistyped one tag name.
> 
> Also it seems that both syntaxes work:
> git diff v0.4..v0.5
> git diff v0.4 v0.5
> 
> The question is: How does git disambiguate between tag names, commits
> and file names? (All may start with a letter) This seems to work
> automagically, and I was desparately looking for an option like "--"
> to separate revisions from file names. I found "SPECIFYING REVISIONS"
> in git-rev-parse(1), so you don't really have to answer.

Yes, you found right answer. "--" option separates file names from
"commits' names". but it usually necessary when you have branches or
tags named as some of your files.
E.g. you have file "test" and you name branch "test"
so "git log test" will complain that it cannot understand your
intention to see log of what and will fail

$ git log test
fatal: ambiguous argument 'test': both revision and filename
Use '--' to separate filenames from revisions

$ git log -- test
will show log of file test

$ git log test --
will show log of branch test


> Also it seems that both syntaxes work:
> git diff v0.4..v0.5
> git diff v0.4 v0.5
honestly, I do not know the difference (at the moment :))
may be gurus or manual will help to discover it
> 
> Regards,
> Ulrich
> 
> >>> Alexey Shumkin <Alex.Crezoff@gmail.com> schrieb am 28.10.2011 um
> >>> 14:59 in
> Nachricht <20111028165943.2cc8253d@ashu.dyn.rarus.ru>:
> > Tag is a pointer to a commit (if to say simply)
> > 
> > e.g. in my repo
> > $ git show-ref --tags --abbrev=7
> > -->8--
> > 676f194 refs/tags/v2.6.7
> > b23c481 refs/tags/v2.6.8
> > -->8--
> > 
> > so
> > 
> > $ git diff v2.6.7..v2.6.8
> > is equivalent to
> > $ git diff 676f194..b23c481
> > 
> > etc
> > > Hi,
> > > 
> > > when using a somewhat older git (of SLES11 SP1 SDK), I could not
> > > find a way to "git diff" between two tag names; I can only diff
> > > between two commit numbers. I can display a changeset using "git
> > > show", but that's not what I wanted. Is it possible to get the
> > > diff I want using older versions, and is such a feature
> > > implemented in the current version? If so, since when?
> > > 
> > > As I'm not subscribed to the list, I'd appreciate CC'ed replies.
> > > Thank you.
> > > 
> > > Greeting
> > > Ulrich
> > > 
> > > 
> > 
> > 
> 
>  
>  
> 

^ permalink raw reply

* Re: git sticker svg
From: Junio C Hamano @ 2011-11-02  9:18 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: Jeff King, git
In-Reply-To: <4EB1002A.6010602@drmicha.warpmail.net>

Michael J Gruber <git@drmicha.warpmail.net> writes:

> I do prefer the rotated, vertically stacked +-G though (with + <-> t, -
> <-> i, G <-> 3/4-circle with arrow). Good thing we don't have to argue
> about an "official" logo...

It somehow reminds me of the OGC logo fiasco, though.

^ permalink raw reply

* Re: [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Junio C Hamano @ 2011-11-02  9:17 UTC (permalink / raw)
  To: Mika Fischer; +Cc: Daniel Stenberg, git
In-Reply-To: <CAOs=hR+u_MrHK4iNFZj4pLVhZ6-_75YpqN7tqWnSjh+di8Lzxw@mail.gmail.com>

Mika Fischer <mika.fischer@zoopnet.de> writes:

> Since I'm new here, I don't really know what the next steps are for
> the patch, should I just wait? Or send it directly to someone?

Resend to the list for re-evaluation, and then we can take it from there.

Thanks.

^ permalink raw reply

* Re: [git patches] libata updates, GPG signed (but see admin notes)
From: Ingo Molnar @ 2011-11-02  9:11 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Junio C Hamano, H. Peter Anvin, git, James Bottomley, Jeff Garzik,
	Andrew Morton, linux-ide, LKML
In-Reply-To: <CA+55aFyKWLUMQFfaeKJKGFPV_7kfOGjf+pSZ1Y8afzkT4OYQ9Q@mail.gmail.com>


* Linus Torvalds <torvalds@linux-foundation.org> wrote:

> And the receiving side would just do the "git pull" and 
> automatically just get notified that "Yes, this push has been 
> signed by key Xyz Abcdef"

If this approach is used then it would be nice to have a .gitconfig 
switch to require trusted pulls by default: to not allow doing 
non-signed or untrusted pulls accidentally, or for Git to warn in a 
visible, hard to miss way if there's a non-signed pull.

This adds social uncertainty (and an element of a silent alarm) to a 
realistic attack: the attacker wouldnt know exactly how the puller 
checks signed pull requests, it's kept private.

Thanks,

	Ingo

^ permalink raw reply

* [RFC/PATCH] http-push: don't always prompt for password (Was Re: [ANNOUNCE] Git 1.7.8.rc0)
From: Stefan Näwe @ 2011-11-02  8:52 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org, Jeff King
In-Reply-To: <7vmxcfn23i.fsf@alter.siamese.dyndns.org>

Am 01.11.2011 19:12, schrieb Junio C Hamano:
> 
> There are only handful of commits that even remotely touch http related
> codepath between v1.7.7 and v1.7.8-rc0:
> 
>   * deba493 http_init: accept separate URL parameter
> 
>   This could change the URL string given to http_auth_init().
> 
>   * 070b4dd http: use hostname in credential description
> 
>   This only changes the prompt string; as far as I understand it, the
>   condition the password is prompted in the callsites of git_getpass()
>   has not changed.
> 
>   * 6cdf022 remote-curl: Fix warning after HTTP failure
>   * be22d92 http: avoid empty error messages for some curl errors
>   * 8abc508 http: remove extra newline in error message
>   * 8d677ed http: retry authentication failures for all http requests
>   * 28d0c10 remote-curl: don't retry auth failures with dumb protocol
> 
>   These shouldn't affect anything wrt prompting, unless you are somehow
>   internally reauthenticating.
> 
> Could you try reverting deba493 and retest, and then if the behaviour is
> the same "need ENTER", further revert 070b4dd and retest?

I did a little more testing.
This WIP makes it work for me (i.e. "need ENTER" is gone, works with
and without .netrc, with 'https://host/repo.git' and 
'https://user@host...' URL). Needs testing, of course.

---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
diff --git a/http.c b/http.c
index a4bc770..008ad72 100644
--- a/http.c
+++ b/http.c
@@ -279,8 +279,6 @@ static CURL *get_curl_handle(void)
        curl_easy_setopt(result, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
 #endif

-       init_curl_http_auth(result);
-
        if (ssl_cert != NULL)
                curl_easy_setopt(result, CURLOPT_SSLCERT, ssl_cert);
        if (has_cert_password())
@@ -846,7 +844,7 @@ static int http_request(const char *url, void *result, int target, int options)
                else if (missing_target(&results))
                        ret = HTTP_MISSING_TARGET;
                else if (results.http_code == 401) {
-                       if (user_name) {
+                       if (user_name && user_pass) {
                                ret = HTTP_NOAUTH;
                        } else {
                                /*
@@ -855,7 +853,8 @@ static int http_request(const char *url, void *result, int target, int options)
                                 * but that is non-portable.  Using git_getpass() can at least be stubbed
                                 * on other platforms with a different implementation if/when necessary.
                                 */
-                               user_name = xstrdup(git_getpass_with_description("Username", description));
+                               if (!user_name)
+                                       user_name = xstrdup(git_getpass_with_description("Username", description));
                                init_curl_http_auth(slot->curl);
                                ret = HTTP_REAUTH;
                        }
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---


Regards,
  Stefan
-- 
----------------------------------------------------------------
/dev/random says: Efficiency takes time! Frugality: who can afford it?
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')"

^ permalink raw reply related

* Re: git sticker svg
From: Michael J Gruber @ 2011-11-02  8:32 UTC (permalink / raw)
  To: Jeff King; +Cc: git
In-Reply-To: <20111101211643.GA12768@sigill.intra.peff.net>

Jeff King venit, vidit, dixit 01.11.2011 22:16:
> If you were at the GSoC mentor summit or the GitTogether last week, you
> may seen Git stickers floating around. I printed 500, thinking there
> would be some leftovers to distribute afterwards. But either git is very
> popular, or somebody decided to re-wallpaper their bedroom, because we
> ran out.
> 
> In case anybody wants to make their own git sticker (or whatever), I'm
> providing the SVG that I sent to the printer. I ordered 2"x4" stickers,
> but it's scalable, you should be able to do any size.
> 
> Credit where credit is due:
> 
> The logo is shamelessly stolen from one Sam Vilain made for GitTogether
> t-shirts in 2008. It's really just the "---/+++" logo done in FreeMono
> with a few pretty colors and outlines.  I have no idea who did the
> original "---/+++" logo. It's awesome, but I couldn't find a nice
> scalable version, hence this.

Yeah, git has been G-+ long before G+ ;)

I do prefer the rotated, vertically stacked +-G though (with + <-> t, -
<-> i, G <-> 3/4-circle with arrow). Good thing we don't have to argue
about an "official" logo...

Michael

^ permalink raw reply

* Re: [PATCH] http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping
From: Mika Fischer @ 2011-11-02  8:21 UTC (permalink / raw)
  To: Daniel Stenberg; +Cc: git
In-Reply-To: <CAOs=hR+YuF+HP0n0132Ktm3RdeWsnVp0Bgt89LNn+VyT6W0mcw@mail.gmail.com>

>> Calling select() with max_fd+1 (== 0) will then not be appreciated by all
>> implementations of select() so that case should probably also be covered by
>> the 50ms sleep approach...
>
> Actually, the 50ms sleep was also implemented using select(0, ...)
> before the patch. I tried to keep the previous behavior when curl does
> not give us any information.
> I assumed that the select(0, ...) was some portable way to sleep with
> microsecond granularity.

Upon a bit of research, it seems that select(0, ...) is indeed quite
commonly used. So I'd just keep it as it was unless you know of a
problem it causes.

Since I'm new here, I don't really know what the next steps are for
the patch, should I just wait? Or send it directly to someone?

Best,
 Mika

^ permalink raw reply

* Antw: Re: Q: "git diff" using tag names
From: Ulrich Windl @ 2011-11-02  7:35 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git
In-Reply-To: <m3aa8l5k1y.fsf@localhost.localdomain>

>>> Jakub Narebski <jnareb@gmail.com> schrieb am 28.10.2011 um 15:21 in Nachricht
<m3aa8l5k1y.fsf@localhost.localdomain>:
> "Ulrich Windl" <Ulrich.Windl@rz.uni-regensburg.de> writes:
> 
> > When using a somewhat older git (of SLES11 SP1 SDK),
> 
> Nb. you can check version of git with "git --version".

Hi!

For the records, it's "1.6.0.2"...

> 
> >                                                      I could not
> > find a way to "git diff" between two tag names; I can only diff
> > between two commit numbers. I can display a changeset using "git
> > show", but that's not what I wanted.
> >
> > Is it possible to get the diff I want using older versions, and is
> > such a feature implemented in the current version? If so, since
> > when?
> 
> From the very beginning in Git you can use tag name where you need
> commit identifier; Git would use commit that tag points to (will
> dereference or peel a tag).

As said before, I was confused by the simplicity: I was looking for an option to specify revisions (as opposed to file names), like "-r" for RCS, but found none. To make things complicated, I had mistyped one tag name without noticing, so I failed to diff, making me think that tag names won't work the way they actually do.

Sorry, and thanks to everybody who helped!

Ulrich

> 
> That is not possible in some [censored] version control systems; I am
> looking at you, Subversion!
> 
> 
> So if you can do
> 
>   $ git show v0.9
>   $ git show v1.0
> 
> you can also do
> 
>   $ git diff v0.9 v1.0
> 
> and
> 
>   $ git log v0.9..v1.0



 

^ 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