Git development
 help / color / mirror / Atom feed
* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-17 16:30 UTC (permalink / raw)
  To: Philippe Vaucher
  Cc: git@vger.kernel.org, Maxime Boissonneault,
	Sébastien Boisvert
In-Reply-To: <CAGK7Mr4R=OwfWt4Kat75C8YDi3iLTavMLxeoLxkf1-gKhxrucg@mail.gmail.com>

On 01/17/2013 09:23 AM, Philippe Vaucher wrote:
>> Anyone has a new idea?
>
> Did you try Jeff King's code to confirm his idea?
>
> Philippe
>

Yes I did, but it was running without any problem....

I find that my test case is "simple" (fresh git clone then "git gc" in a 
crontab), I bet anyone who has access to a Lustre filesystem can 
reproduce the problem...  The problem is to have such a filesystem to do 
the tests....

But I am available to do it...

Thanks,

Eric

^ permalink raw reply

* Re: GIT get corrupted on lustre
From: Philippe Vaucher @ 2013-01-17 14:23 UTC (permalink / raw)
  To: Eric Chamberland
  Cc: git@vger.kernel.org, Maxime Boissonneault,
	Sébastien Boisvert
In-Reply-To: <50F7F793.80507@giref.ulaval.ca>

> Anyone has a new idea?

Did you try Jeff King's code to confirm his idea?

Philippe

^ permalink raw reply

* merge vs. rebase question
From: Dennis Putnam @ 2013-01-17 14:14 UTC (permalink / raw)
  To: git@vger.kernel.org

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

As a git noob I am having trouble understanding when to use which
commands. I have a repository (bare) on my Linux server. I also created
a build directory as a local repository. In my build script I do a 'git
pull' to make sure the build directory is up to date. No changes are
made to my source so this repository never does an 'add' or 'commit'.
When I run my script with 'pull', the output indicates that changes were
found and seems to have pulled them into the local directory. However,
when I look at the resulting source, none of the expected changes show
up. I then tried a 'fetch' and 'rebase'. That worked but I don't
understand why. I thought 'pull' did a 'fetch' and a 'merge' so I don't
understand why a 'fetch' and 'rebase' worked but 'fetch' and 'merge' did
not. Unless my understanding of what 'pull' does is wrong. In my case,
what should I be using in my script to assure that the build directory
is current?

Thanks.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Chris Rorvick @ 2013-01-17 13:09 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Max Horn, git, Angelo Borsotti, Drew Northup, Michael Haggerty,
	Philip Oakley, Johannes Sixt, Kacper Kornet, Jeff King,
	Felipe Contreras
In-Reply-To: <7vehhkuwg5.fsf@alter.siamese.dyndns.org>

On Thu, Jan 17, 2013 at 12:59 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Chris Rorvick <chris@rorvick.com> writes:
>
>> On Wed, Jan 16, 2013 at 10:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
>>> It is fine when pushing into "refs/tags/" hierarchy.  It is *NOT*
>>> OK if the type check does not satisfy this function.  In that case,
>>> we do not actually see the existence of the destination as a
>>> problem, but it is reported as such.  We are blocking because we do
>>> not like the type of the new object or the type of the old object.
>>> If the destination points at a commit, the push can succeed if the
>>> user changes what object to push, so saying "you cannot push because
>>> the destination already exists" is just wrong in such a case.
>>
>> So the solution is to revert back to recommending a merge?
>
> Of course not, because at that point you may not even have what you
> were attempting to overwrite.  Nobody says it is even something you
> could merge.

I was referring to your concern about rejecting based on type.  A push
causing a reference to move (for example) from a commit to a blob is
rejected as "already exists" with this patch.  You emphatically state
this is not OK and your solution is to revert back to behavior that
advises a merge.

Clearly the bug regarding an 'old' unknown to the client should be
fixed.  This is a obvious test case I should have covered and it's
unfortunate it made it into master.  But I don't understand why
is_forwardable() was misguided (maybe poorly named) nor why
ref_newer() is a better place to solve the issues it was addressing.

Chris

^ permalink raw reply

* Re: GIT get corrupted on lustre
From: Eric Chamberland @ 2013-01-17 13:07 UTC (permalink / raw)
  To: git; +Cc: Maxime Boissonneault, Sébastien Boisvert
In-Reply-To: <50EDDF12.3080800@giref.ulaval.ca>

Hi!

I still have the corruption problems....

We just compiled a git without threads to try... (by the way, 
--without-pthreads doesn't work, you have to do a --disable-pthreads 
instead).

And to remove the warnings about threads at "git gc" execution, I did a:

git config --local pack.threads 1

and cloned a repository and started to do:

git gc

once every hour.

Then this night (at 05:35:02 exactly), the same error as usual occurred:

error: index file 
.git/objects/pack/pack-bf0748cee64a1964be0a1061c82aca51c993b825.idx is 
too small
error: refs/heads/master does not point to a valid object!

So now I am convinced that it is not a thread problem....

I am kind of discouraged, we like to use git, but in this case we have 
this error which seems unsolvable!

Anyone has a new idea?

Thanks,

Eric


On 01/09/2013 04:20 PM, Eric Chamberland wrote:
> Hi Brian,
>
> On 01/08/2013 11:11 AM, Eric Chamberland wrote:
>> On 12/24/2012 10:11 AM, Brian J. Murrell wrote:
>>> Have you tried adding a "-q" to the git command line to quiet down git's
>>> "feedback" messages?
>>>
>>
>
> I moved to git 1.8.1 and added the "-q" to the command "git gc" but it
> occured to return an error, so the "-q" option is not avoiding the
> problem here... :-/
>
> command in crontab:
>
> cd /rap/jsf-051-aa/ericc/tests_git_clones/GIREF && for i in seq 10; do
> /software/apps/git/1.8.1/bin/git gc -q || true;done
>
> results:
> error: index file
> .git/objects/pack/pack-1f09879c88cd71a15dcc891713cf038d249830ad.idx is
> too small
> error: refs/remotes/origin/BIB_Branche_1_4_x does not point to a valid
> object!
>
> and this clone was a "clean" clone in which only "git qc -q" has been
> run on....
>
> I still have a doubt on threads....
>
> Eric
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] combine-diff: suppress a clang warning
From: John Keeping @ 2013-01-17 11:23 UTC (permalink / raw)
  To: Antoine Pelisse; +Cc: Max Horn, git, Johannes Sixt, Junio C Hamano
In-Reply-To: <20130117110008.GD4574@serenity.lan>

When compiling combine-diff.c, clang 3.2 says:

    combine-diff.c:1006:19: warning: adding 'int' to a string does not
	    append to the string [-Wstring-plus-int]
		prefix = COLONS + offset;
			 ~~~~~~~^~~~~~~~
    combine-diff.c:1006:19: note: use array indexing to silence this warning
		prefix = COLONS + offset;
				^
			 &      [       ]

Suppress this by making the suggested change.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
On Thu, Jan 17, 2013 at 11:00:08AM +0000, John Keeping wrote:
> On Thu, Jan 17, 2013 at 11:32:39AM +0100, Antoine Pelisse wrote:
> There is one remaining warning on pu which hasn't been discussed in this
> thread as far as I can see.  I'll send a patch shortly.

... and here it is.

 combine-diff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/combine-diff.c b/combine-diff.c
index bb1cc96..dba4748 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -1003,7 +1003,7 @@ static void show_raw_diff(struct combine_diff_path *p, int num_parent, struct re
 		offset = strlen(COLONS) - num_parent;
 		if (offset < 0)
 			offset = 0;
-		prefix = COLONS + offset;
+		prefix = &COLONS[offset];
 
 		/* Show the modes */
 		for (i = 0; i < num_parent; i++) {
-- 
1.8.1

^ permalink raw reply related

* Re: [PATCH 2/2] fix clang -Wtautological-compare with unsigned enum
From: John Keeping @ 2013-01-17 11:00 UTC (permalink / raw)
  To: Antoine Pelisse; +Cc: Max Horn, git, Johannes Sixt, Junio C Hamano
In-Reply-To: <CALWbr2wk+78zxGKCo-hCOwMuMOzdGspYvMu7PA6o0OYM3Y3m4A@mail.gmail.com>

On Thu, Jan 17, 2013 at 11:32:39AM +0100, Antoine Pelisse wrote:
> John, could you confirm that you trigger the -Wtautological-compare
> warning with your version of clang ?

Yes, the warning is still there with both 3.2 and a recent trunk build
but this patch squelches it.

> And that this patch makes clang compilation warning-free (with the
> very latest clang) ?

There is one remaining warning on pu which hasn't been discussed in this
thread as far as I can see.  I'll send a patch shortly.

There's also a warning that triggers with clang 3.2 but not clang trunk, which
I think is a legitimate warning - perhaps someone who understands integer type
promotion better than me can explain why the code is OK (patch->score is
declared as 'int'):

builtin/apply.c:1044:47: warning: comparison of constant 18446744073709551615
    with expression of type 'int' is always false
    [-Wtautological-constant-out-of-range-compare]
        if ((patch->score = strtoul(line, NULL, 10)) == ULONG_MAX)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~


> On Wed, Jan 16, 2013 at 11:47 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
> > Create a GREP_HEADER_FIELD_MIN so we can check that the field value is
> > sane and silent the clang warning.
> >
> > Clang warning happens because the enum is unsigned (this is
> > implementation-defined, and there is no negative fields) and the check
> > is then tautological.
> >
> > Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
> > ---
> > I tried to consider discussion [1] and this [2] discussion on clang's list
> >
> > With these two patches and the patch from Max Horne, I'm finally able to
> > compile with CC=clang CFLAGS=-Werror.
> >
> >  [1]: http://thread.gmane.org/gmane.comp.version-control.git/184908
> >  [2]: http://clang-developers.42468.n3.nabble.com/Possibly-invalid-enum-tautology-warning-td3233140.html
> >
> >  grep.c | 3 ++-
> >  grep.h | 3 ++-
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/grep.c b/grep.c
> > index 4bd1b8b..bb548ca 100644
> > --- a/grep.c
> > +++ b/grep.c
> > @@ -625,7 +625,8 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
> >         for (p = opt->header_list; p; p = p->next) {
> >                 if (p->token != GREP_PATTERN_HEAD)
> >                         die("bug: a non-header pattern in grep header list.");
> > -               if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
> > +               if (p->field < GREP_HEADER_FIELD_MIN ||
> > +                   GREP_HEADER_FIELD_MAX <= p->field)
> >                         die("bug: unknown header field %d", p->field);
> >                 compile_regexp(p, opt);
> >         }
> > diff --git a/grep.h b/grep.h
> > index 8fc854f..e4a1df5 100644
> > --- a/grep.h
> > +++ b/grep.h
> > @@ -28,7 +28,8 @@ enum grep_context {
> >  };
> >
> >  enum grep_header_field {
> > -       GREP_HEADER_AUTHOR = 0,
> > +       GREP_HEADER_FIELD_MIN = 0,
> > +       GREP_HEADER_AUTHOR = GREP_HEADER_FIELD_MIN,
> >         GREP_HEADER_COMMITTER,
> >         GREP_HEADER_REFLOG,
> >
> > --
> > 1.8.1.1.435.g20d29be.dirty
> >

^ permalink raw reply

* Re: [PATCH 2/2] fix clang -Wtautological-compare with unsigned enum
From: Antoine Pelisse @ 2013-01-17 10:32 UTC (permalink / raw)
  To: John Keeping, Max Horn
  Cc: git, Johannes Sixt, Junio C Hamano, Antoine Pelisse
In-Reply-To: <1358376443-7404-2-git-send-email-apelisse@gmail.com>

John, could you confirm that you trigger the -Wtautological-compare
warning with your version of clang ?
And that this patch makes clang compilation warning-free (with the
very latest clang) ?

Cheers,

On Wed, Jan 16, 2013 at 11:47 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
> Create a GREP_HEADER_FIELD_MIN so we can check that the field value is
> sane and silent the clang warning.
>
> Clang warning happens because the enum is unsigned (this is
> implementation-defined, and there is no negative fields) and the check
> is then tautological.
>
> Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
> ---
> I tried to consider discussion [1] and this [2] discussion on clang's list
>
> With these two patches and the patch from Max Horne, I'm finally able to
> compile with CC=clang CFLAGS=-Werror.
>
>  [1]: http://thread.gmane.org/gmane.comp.version-control.git/184908
>  [2]: http://clang-developers.42468.n3.nabble.com/Possibly-invalid-enum-tautology-warning-td3233140.html
>
>  grep.c | 3 ++-
>  grep.h | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/grep.c b/grep.c
> index 4bd1b8b..bb548ca 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -625,7 +625,8 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
>         for (p = opt->header_list; p; p = p->next) {
>                 if (p->token != GREP_PATTERN_HEAD)
>                         die("bug: a non-header pattern in grep header list.");
> -               if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
> +               if (p->field < GREP_HEADER_FIELD_MIN ||
> +                   GREP_HEADER_FIELD_MAX <= p->field)
>                         die("bug: unknown header field %d", p->field);
>                 compile_regexp(p, opt);
>         }
> diff --git a/grep.h b/grep.h
> index 8fc854f..e4a1df5 100644
> --- a/grep.h
> +++ b/grep.h
> @@ -28,7 +28,8 @@ enum grep_context {
>  };
>
>  enum grep_header_field {
> -       GREP_HEADER_AUTHOR = 0,
> +       GREP_HEADER_FIELD_MIN = 0,
> +       GREP_HEADER_AUTHOR = GREP_HEADER_FIELD_MIN,
>         GREP_HEADER_COMMITTER,
>         GREP_HEADER_REFLOG,
>
> --
> 1.8.1.1.435.g20d29be.dirty
>

^ permalink raw reply

* Re: [PATCH] fix some clang warnings
From: John Keeping @ 2013-01-17 10:24 UTC (permalink / raw)
  To: Jeff King; +Cc: Max Horn, Antoine Pelisse, Junio C Hamano, git, Johannes Sixt
In-Reply-To: <20130116190137.GD2476@farnsworth.metanate.com>

On Wed, Jan 16, 2013 at 07:01:37PM +0000, John Keeping wrote:
> On Wed, Jan 16, 2013 at 10:24:49AM -0800, Jeff King wrote:
> > On Wed, Jan 16, 2013 at 06:22:40PM +0000, John Keeping wrote:
> > 
> > Thanks for checking. I'd rather squelch the warning completely (as in my
> > re-post of Max's patch from a few minutes ago), and we can loosen it
> > (possibly with a version check) later when a fix is widely disseminated.
> 
> I checked again with a trunk build of clang and the warning's still
> there, so I've created a clang bug [1] to see if they will change the
> behaviour.
> 
> [1] http://llvm.org/bugs/show_bug.cgi?id=14968

Well, that was quick!  This warning is now gone when using a fresh trunk
build of clang.

>From [2], it looks like this will become version 3.3 (in about 5
months).  So should we change the condition to:

#if defined(__GNUC__) && (!defined(__clang__) ||
	__clang_major__ > 3 || \
        (__clang__major == 3 && __clang_minor__ >= 3)


[2] http://llvm.org/docs/HowToReleaseLLVM.html


John

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Junio C Hamano @ 2013-01-17  6:59 UTC (permalink / raw)
  To: Chris Rorvick
  Cc: Max Horn, git, Angelo Borsotti, Drew Northup, Michael Haggerty,
	Philip Oakley, Johannes Sixt, Kacper Kornet, Jeff King,
	Felipe Contreras
In-Reply-To: <CAEUsAPb0Zg0x78e+12NqXA4PRBkOUO89KTgxtwxujS1KOx9NYg@mail.gmail.com>

Chris Rorvick <chris@rorvick.com> writes:

> On Wed, Jan 16, 2013 at 10:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> It is fine when pushing into "refs/tags/" hierarchy.  It is *NOT*
>> OK if the type check does not satisfy this function.  In that case,
>> we do not actually see the existence of the destination as a
>> problem, but it is reported as such.  We are blocking because we do
>> not like the type of the new object or the type of the old object.
>> If the destination points at a commit, the push can succeed if the
>> user changes what object to push, so saying "you cannot push because
>> the destination already exists" is just wrong in such a case.
>
> So the solution is to revert back to recommending a merge?

Of course not, because at that point you may not even have what you
were attempting to overwrite.  Nobody says it is even something you
could merge.

The recommended solution certainly will involve a "fetch" (not
"pull" or "pull --rebase").  You fetch from over there to check what
you were about to overwrite, examine the situation to decide what
the appropriate action is.

The point is that Git in general, and the codepath that was touched
by the patch in particular, does not have enough information to
decide what the appropriate action is for the user, especially when
the ref is outside the ones we know what the conventional uses of
them are.  We can make policy decisions like "tags are meant to be
unmoving anchor points, so it is unusual to overwrite any old with
any new", "heads are meant to be branch tips, and because rewinding
them while more than one repositories are working with them will
cause issues to other repositories, it is unusual to push a
non-fast-forward" and enforcement mechanism for such policy
decisions will help users, but that is only because we know what
their uses are.

The immediate action we should take is to get closer to the original
behaviour of not complaining with "ref already exists", which is
nonsensical.  That does not mean that we will forbid improving the
codepath by giving different advices depending on the case.

One of the new advices could tell them to "fetch it and inspect the
situation", if old is not something we do not even have (hence we
cannot check its type, let alone the ancestry relationship of it
with new), for example.

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Chris Rorvick @ 2013-01-17  6:20 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Max Horn, git, Angelo Borsotti, Drew Northup, Michael Haggerty,
	Philip Oakley, Johannes Sixt, Kacper Kornet, Jeff King,
	Felipe Contreras
In-Reply-To: <7vobgpxeel.fsf@alter.siamese.dyndns.org>

On Wed, Jan 16, 2013 at 10:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
> It is fine when pushing into "refs/tags/" hierarchy.  It is *NOT*
> OK if the type check does not satisfy this function.  In that case,
> we do not actually see the existence of the destination as a
> problem, but it is reported as such.  We are blocking because we do
> not like the type of the new object or the type of the old object.
> If the destination points at a commit, the push can succeed if the
> user changes what object to push, so saying "you cannot push because
> the destination already exists" is just wrong in such a case.

So the solution is to revert back to recommending a merge?

^ permalink raw reply

* Re: Question re. git remote repository
From: Matt Seitz @ 2013-01-17  5:20 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: david@lang.hm, 'matseitz@cisco.com'

"David Lang" <david@lang.hm> wrote in message news:<alpine.DEB.2.02.1301161843390.21503@nftneq.ynat.uz>...
> >>
> >> On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:
> >>
> >>> 2. a repository where only one user does "git add" and "git commit",
> >> while other users will do "git pull", the peer-to-peer model (you pull changes
> >> from me, I pull changes from you).
> >>
> 
> you may _be_ safe, and if others who really know the internals speak up, take 
> their word on it. 

Well, we already have Linus's article.  I guess the question is whether the use case I describe above falls under:

A. "maintenance operations"

B. "normal git workflow"

Personally, I would consider this use case to be a "normal git workflow".

^ permalink raw reply

* Re: [PATCH v2 07/14] imap-send.c: inline imap_parse_list() in imap_list()
From: Michael Haggerty @ 2013-01-17  4:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Matt Kraai, git, Jonathan Nieder
In-Reply-To: <7vip6xywdf.fsf@alter.siamese.dyndns.org>

On 01/16/2013 04:34 PM, Junio C Hamano wrote:
> Michael Haggerty <mhagger@alum.mit.edu> writes:
> 
>> On 01/15/2013 07:51 PM, Matt Kraai wrote:
>>> On Tue, Jan 15, 2013 at 09:06:25AM +0100, Michael Haggerty wrote:
>>>> -static struct imap_list *parse_imap_list(struct imap *imap, char **sp)
>>>> +static struct imap_list *parse_list(char **sp)
>>>
>>> The commit subject refers to imap_parse_list and imap_list whereas the
>>> code refers to parse_imap_list and parse_list.
>>
>> Yes, you're right.  Thanks.
> 
> I think I've fixed this (and some other minor points in other
> patches in the series) while queuing; please check master..3691031c
> after fetching from me.

Looks good.  Thanks.

Michael

-- 
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Chris Rorvick @ 2013-01-17  3:42 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Max Horn, git, Angelo Borsotti, Drew Northup,
	Michael Haggerty, Philip Oakley, Johannes Sixt, Kacper Kornet,
	Felipe Contreras
In-Reply-To: <20130117031100.GA7264@sigill.intra.peff.net>

On Wed, Jan 16, 2013 at 9:11 PM, Jeff King <peff@peff.net> wrote:
>> is_forwardable() did solve a UI issue.  Previously all instances where
>> old is not reachable by new were assumed to be addressable with a
>> merge.  is_forwardable() attempted to determine if the concept of
>> forwarding made sense given the inputs.  For example, if old is a blob
>> it is useless to suggest merging it.
>
> I think it makes sense to mark such a case as different from a regular
> non-fast-forward (because "git pull" is not the right advice), but:
>
>   1. is_forwardable should assume a missing object is a commit not to
>      regress the common case; otherwise we do not show the pull advice
>      when we probably should, and most of the time it is going to be a
>      commit

Yes, obviously this was a bug, thus the use of "attempted" above.  It
would have been better to assume a missing 'old' was potentially
forwardable to present the user with the most helpful advice.

>   2. When we know that we are not working with commits, I am not sure
>      that "already exists" is the right advice to give for such a case.
>      It is neither "this tag already exists, so we do not update it",
>      nor is it strictly "cannot fast forward this commit", but rather
>      something else.

But the reference already existing in the remote is a substantial
reason for not allowing the push in all of these cases.  You can break
this out further if you like to explain why the specific reference
shouldn't be moved on the remote, but this is even more complicated a
simple "is old reachable from new?" test.

Chris

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Jeff King @ 2013-01-17  3:11 UTC (permalink / raw)
  To: Chris Rorvick
  Cc: Junio C Hamano, Max Horn, git, Angelo Borsotti, Drew Northup,
	Michael Haggerty, Philip Oakley, Johannes Sixt, Kacper Kornet,
	Felipe Contreras
In-Reply-To: <CAEUsAPY8T9TYCrZLWB-0Mwae_NtnqqVvGwY+4jGfqh5Lh3=Dgw@mail.gmail.com>

On Wed, Jan 16, 2013 at 08:19:28PM -0600, Chris Rorvick wrote:

> On Wed, Jan 16, 2013 at 11:43 AM, Jeff King <peff@peff.net> wrote:
> > I think that is a reasonable rule that could be applied across all parts
> > of the namespace hierarchy. And it could be applied by the client,
> > because all you need to know is whether ref->old_sha1 is reachable from
> > ref->new_sha1.
> 
> is_forwardable() did solve a UI issue.  Previously all instances where
> old is not reachable by new were assumed to be addressable with a
> merge.  is_forwardable() attempted to determine if the concept of
> forwarding made sense given the inputs.  For example, if old is a blob
> it is useless to suggest merging it.

I think it makes sense to mark such a case as different from a regular
non-fast-forward (because "git pull" is not the right advice), but:

  1. is_forwardable should assume a missing object is a commit not to
     regress the common case; otherwise we do not show the pull advice
     when we probably should, and most of the time it is going to be a
     commit

  2. When we know that we are not working with commits, I am not sure
     that "already exists" is the right advice to give for such a case.
     It is neither "this tag already exists, so we do not update it",
     nor is it strictly "cannot fast forward this commit", but rather
     something else.

     The expanded definition of "what is a fast forward" that I
     suggested would let this fall naturally between the two.

-Peff

^ permalink raw reply

* RE: Question re. git remote repository
From: David Lang @ 2013-01-17  2:49 UTC (permalink / raw)
  To: Matt Seitz (matseitz); +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <A0DB01D693D8EF439496BC8B037A0AEF32209B45@xmb-rcd-x15.cisco.com>

On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:

>> From: David Lang [mailto:david@lang.hm]
>>
>> On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:
>>
>>> 1. a bare repository that is normally accessed only by "git push" and
>>> "git pull" (or "git fetch"), the central repository model.
>>
>> pulling from it would not be a problem, I could see issues with multiple
>> pushes taking place (the underlying repository would not get corrupted, but you
>> will very quickly hit conflicts where the push is not a fast forward and you
>> need to merge, not just push)
>
> How is that different on a network file system, as opposed to using http, ssh, or git-daemon?  Don't you get a "not a fast-forward" error, regardless of the protocol?

true.

>>> 2. a repository where only one user does "git add" and "git commit",
>> while
>>> other users will do "git pull", the peer-to-peer model (you pull changes
>> from
>>> me, I pull changes from you).
>>
>>
>> pulling from a shared repository is probably safe, but I wouldn't bet
>> against
>> there being any conditions where a pull at the same time someone is doing
>> an
>> update being able to cause problems.
>
> Why do you think there would be a problem?
>
>> The normal thing is to do the pulls through git-daemon, and that does make
>> sure
>> that what you are pulling is consistant.
>
> What does "git pull" via git-daemon do to ensure consistency that is different from "git pull" on a network file system?

git pull via the daemon looks at what tree items you have on each end, and then 
it sends you the items needed to make you match the server. If there are partial 
updates on the server (due to some update in process) the daemon should not see 
that, but if you are grabbing the files directly, I would be less confident that 
you are always safe.

you may _be_ safe, and if others who really know the internals speak up, take 
their word on it. But, absent assurances that we know that everything is done in 
the right order in the face of a networked filesystem (which may break 
visibility of changes due to caching), I would not trust such raw access for 
updates at all, and only somewhat trust it for read-only use.

David Lang

^ permalink raw reply

* RE: Question re. git remote repository
From: Matt Seitz (matseitz) @ 2013-01-17  2:25 UTC (permalink / raw)
  To: David Lang; +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <alpine.DEB.2.02.1301161756240.21503@nftneq.ynat.uz>

> From: David Lang [mailto:david@lang.hm]
> 
> On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:
> 
> > 1. a bare repository that is normally accessed only by "git push" and
> > "git pull" (or "git fetch"), the central repository model.
> 
> pulling from it would not be a problem, I could see issues with multiple
> pushes taking place (the underlying repository would not get corrupted, but you
> will very quickly hit conflicts where the push is not a fast forward and you
> need to merge, not just push)

How is that different on a network file system, as opposed to using http, ssh, or git-daemon?  Don't you get a "not a fast-forward" error, regardless of the protocol?

> > 2. a repository where only one user does "git add" and "git commit",
> while
> > other users will do "git pull", the peer-to-peer model (you pull changes
> from
> > me, I pull changes from you).
> 
> 
> pulling from a shared repository is probably safe, but I wouldn't bet
> against
> there being any conditions where a pull at the same time someone is doing
> an
> update being able to cause problems.

Why do you think there would be a problem?

> The normal thing is to do the pulls through git-daemon, and that does make
> sure
> that what you are pulling is consistant.

What does "git pull" via git-daemon do to ensure consistency that is different from "git pull" on a network file system?

^ permalink raw reply

* Re: [PATCH v6 0/8] push: update remote tags only with force
From: Chris Rorvick @ 2013-01-17  2:19 UTC (permalink / raw)
  To: Jeff King
  Cc: Junio C Hamano, Max Horn, git, Angelo Borsotti, Drew Northup,
	Michael Haggerty, Philip Oakley, Johannes Sixt, Kacper Kornet,
	Felipe Contreras
In-Reply-To: <20130116174325.GA27525@sigill.intra.peff.net>

On Wed, Jan 16, 2013 at 11:43 AM, Jeff King <peff@peff.net> wrote:
> I think that is a reasonable rule that could be applied across all parts
> of the namespace hierarchy. And it could be applied by the client,
> because all you need to know is whether ref->old_sha1 is reachable from
> ref->new_sha1.

is_forwardable() did solve a UI issue.  Previously all instances where
old is not reachable by new were assumed to be addressable with a
merge.  is_forwardable() attempted to determine if the concept of
forwarding made sense given the inputs.  For example, if old is a blob
it is useless to suggest merging it.

Chris

^ permalink raw reply

* RE: Question re. git remote repository
From: David Lang @ 2013-01-17  1:59 UTC (permalink / raw)
  To: Matt Seitz (matseitz); +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <A0DB01D693D8EF439496BC8B037A0AEF32209AD2@xmb-rcd-x15.cisco.com>

On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:

>> From: David Lang [mailto:david@lang.hm]
>>
>> Linus says that git does not have "proper locking", so think about it,
>> what do
>> you think will happen if person A does git add a/b; git commit and person
>> B does
>> git add c/d; git commit?
>
> Sorry, I wasn't clear. My assumption is that a shared repository on a network file system will either be:
>
> 1. a bare repository that is normally accessed only by "git push" and "git pull" (or "git fetch"), the central repository model.

pulling from it would not be a problem, I could see issues with multiple pushes 
taking place (the underlying repository would not get corrupted, but you will 
very quickly hit conflicts where the push is not a fast forward and you need to 
merge, not just push)

> 2. a repository where only one user does "git add" and "git commit", while 
> other users will do "git pull", the peer-to-peer model (you pull changes from 
> me, I pull changes from you).

At this point only one system is writing to the repository and it doesn't matter 
that it's on network storage vs local storage.

pulling from a shared repository is probably safe, but I wouldn't bet against 
there being any conditions where a pull at the same time someone is doing an 
update being able to cause problems.

The normal thing is to do the pulls through git-daemon, and that does make sure 
that what you are pulling is consistant.

David Lang

^ permalink raw reply

* RE: Question re. git remote repository
From: Matt Seitz (matseitz) @ 2013-01-17  1:46 UTC (permalink / raw)
  To: David Lang; +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <alpine.DEB.2.02.1301161721110.21503@nftneq.ynat.uz>

> From: David Lang [mailto:david@lang.hm]
> 
> Linus says that git does not have "proper locking", so think about it,
> what do
> you think will happen if person A does git add a/b; git commit and person
> B does
> git add c/d; git commit?

Sorry, I wasn't clear. My assumption is that a shared repository on a network file system will either be: 

1. a bare repository that is normally accessed only by "git push" and "git pull" (or "git fetch"), the central repository model.

2. a repository where only one user does "git add" and "git commit", while other users will do "git pull", the peer-to-peer model (you pull changes from me, I pull changes from you).

^ permalink raw reply

* RE: Question re. git remote repository
From: David Lang @ 2013-01-17  1:26 UTC (permalink / raw)
  To: Matt Seitz (matseitz); +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <A0DB01D693D8EF439496BC8B037A0AEF32209A54@xmb-rcd-x15.cisco.com>

On Thu, 17 Jan 2013, Matt Seitz (matseitz) wrote:

>> From: David Lang [mailto:david@lang.hm]
>>
>> On Wed, 16 Jan 2013, Matt Seitz (matseitz) wrote:
>>
>>> Linus seemed to think it should work:
>>>
>>> http://permalink.gmane.org/gmane.comp.version-control.git/122670
>>
>> In the link you point at, he says that you can have problems with some
>> types of
>> actions. He points out things like git prune,
>
> Linus wrote:
>
> You do need to be a bit careful if you do maintenance operations
> concurrently (I would suggest avoiding doing concurrent "git gc --prune",
> for example), but any normal git workflow should be fine.
>
>> but I would also say that there
>> are probably race conditions if you have two git processes that try to
>> change the HEAD to different things at the same time.
>
> What makes you think there are race conditions?
>
> Linus wrote:
>
> And git doesn't have "proper locking", because it doesn't need it for
> database ops: git objects are stable. For refs, git should be using the
> proper NFS-safe "create and atomic rename" ops.

As Linus points out, objects are stable, so when you create objects you don't 
have to worry about locking, if two things write an object at the same time, the 
same contents are being written so races don't matter.

However, if you have two people doing a commit or merge, you will get different 
results based on the order they are happening in. This seems to be exactly the 
type of thing that falls into the 'maintinance operations' category.

Linus says that git does not have "proper locking", so think about it, what do 
you think will happen if person A does git add a/b; git commit and person B does 
git add c/d; git commit?

Since the tree will look different depending on what order these four commands 
execute in, the resulting HEAD could have multiple different values depending on 
the order. The individual commits may even be different.

David Lang

>>> And "git init" specifically has a "shared" option:
>>>
>>> --shared[=(false|true|umask|group|all|world|everybody|0xxx)]
>>
>> I think this is dealing with multiple users _reading_ a repository, not
>> making
>> updates to it at the same time.
>
> The description of "shared" says "This allows users belonging to the same 
> group to push into that repository."  The "push" command is about making 
> updates.

^ permalink raw reply

* RE: Question re. git remote repository
From: Matt Seitz (matseitz) @ 2013-01-17  1:09 UTC (permalink / raw)
  To: David Lang; +Cc: git@vger.kernel.org, ishchis2@gmail.com
In-Reply-To: <alpine.DEB.2.02.1301161617240.21503@nftneq.ynat.uz>

> From: David Lang [mailto:david@lang.hm]
> 
> On Wed, 16 Jan 2013, Matt Seitz (matseitz) wrote:
> 
> > Linus seemed to think it should work:
> >
> > http://permalink.gmane.org/gmane.comp.version-control.git/122670
> 
> In the link you point at, he says that you can have problems with some
> types of
> actions. He points out things like git prune, 

Linus wrote:

You do need to be a bit careful if you do maintenance operations 
concurrently (I would suggest avoiding doing concurrent "git gc --prune", 
for example), but any normal git workflow should be fine.

> but I would also say that there
> are probably race conditions if you have two git processes that try to
> change the HEAD to different things at the same time.

What makes you think there are race conditions?

Linus wrote:

And git doesn't have "proper locking", because it doesn't need it for 
database ops: git objects are stable. For refs, git should be using the 
proper NFS-safe "create and atomic rename" ops.

> > And "git init" specifically has a "shared" option:
> >
> > --shared[=(false|true|umask|group|all|world|everybody|0xxx)]
> 
> I think this is dealing with multiple users _reading_ a repository, not
> making
> updates to it at the same time.

The description of "shared" says "This allows users belonging to the same group to push into that repository."  The "push" command is about making updates.

^ permalink raw reply

* Re: [PATCH] Add Auto-Submitted header to post-receive-email
From: Jonathan Nieder @ 2013-01-17  0:49 UTC (permalink / raw)
  To: Chris Hiestand
  Cc: Andy Parkins, Junio C Hamano, git, Michael Haggerty,
	Kevin P. Fleming
In-Reply-To: <258F0FE2-D014-4624-A1E2-721E51F0E12C@salk.edu>

Hi Chris,

Chris Hiestand wrote:

> Andy, do you have any thoughts on adding this email header to
> contrib/hooks/post-receive-email? This patch shouldn't cause problems for anyone
> with a sanely configured mail delivery agent, and the additional header is very
> useful in toggling auto responses.

I'm not Andy, but it sounds very sane to me.  So for what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks,
Jonathan

(patch left unsnipped for reference)

> This conforms to RFC3834 and is useful in preventing eg
> vacation auto-responders from replying by default
>
> Signed-off-by: Chris Hiestand <chiestand@salk.edu>
> ---
>  contrib/hooks/post-receive-email |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
> index b2171a0..0e5b72d 100755
> --- a/contrib/hooks/post-receive-email
> +++ b/contrib/hooks/post-receive-email
> @@ -237,6 +237,7 @@ generate_email_header()
>  	X-Git-Reftype: $refname_type
>  	X-Git-Oldrev: $oldrev
>  	X-Git-Newrev: $newrev
> +	Auto-Submitted: auto-generated
>  
>  	This is an automated email from the git hooks/post-receive script. It was
>  	generated because a ref change was pushed to the repository containing
> -- 
> 1.7.10.4

^ permalink raw reply

* Re: [RFC/PATCH 2/8 v3] git_remote_helpers: fix input when running under Python 3
From: Pete Wyckoff @ 2013-01-17  0:29 UTC (permalink / raw)
  To: John Keeping
  Cc: Junio C Hamano, Michael Haggerty, git, Eric S. Raymond,
	Felipe Contreras, Sverre Rabbelier
In-Reply-To: <20130116094418.GA9089@river>

john@keeping.me.uk wrote on Wed, 16 Jan 2013 09:45 +0000:
> On Tue, Jan 15, 2013 at 07:03:16PM -0500, Pete Wyckoff wrote:
> > I'd suggest for this Python conundrum using byte-string literals, e.g.:
> > 
> >         lines = check_output(args).strip().split(b'\n')
> > 	value, name = line.split(b' ')
> > 	name = name.strip(b'commit\t')
> > 
> > Essentially identical to what you have, but avoids naming "utf-8" as
> > the encoding.  It instead relies on Python's interpretation of
> > ASCII characters in string context, which is exactly what C does.
> 
> The problem is that AFAICT the byte-string prefix is only available in
> Python 2.7 and later (compare [1] and [2]).  I think we need this more
> convoluted code if we want to keep supporting Python 2.6 (although
> perhaps 'ascii' would be a better choice than 'utf-8').
> 
> [1] http://docs.python.org/2.6/reference/lexical_analysis.html#literals
> [2] http://docs.python.org/2.7/reference/lexical_analysis.html#literals

Drat.  The b'' syntax seems to work on 2.6.8, in spite of
the docs, but certainly isn't in 2.5.

I think you had hit on the best compromise with encoding,
but maybe ascii is a little less presumptuous than utf-8,
and more indicative of the encoding assumption.

		-- Pete

^ permalink raw reply

* Re: [PATCH 3/8] git_remote_helpers: Force rebuild if python version changes
From: Pete Wyckoff @ 2013-01-17  0:27 UTC (permalink / raw)
  To: John Keeping; +Cc: git, Eric S. Raymond, Felipe Contreras, Sverre Rabbelier
In-Reply-To: <20130115225805.GA4574@serenity.lan>

john@keeping.me.uk wrote on Tue, 15 Jan 2013 22:58 +0000:
> For reference, putting the version check in setup.py looks like this:
> 
> -- >8 --
> 
> diff --git a/git_remote_helpers/setup.py b/git_remote_helpers/setup.py
> index 6de41de..2c21eb5 100644
> --- a/git_remote_helpers/setup.py
> +++ b/git_remote_helpers/setup.py
> @@ -3,6 +3,7 @@
>  """Distutils build/install script for the git_remote_helpers package."""
>  
>  from distutils.core import setup
> +import sys
>  
>  # If building under Python3 we need to run 2to3 on the code, do this by
>  # trying to import distutils' 2to3 builder, which is only available in
> @@ -13,6 +14,24 @@ except ImportError:
>      # 2.x
>      from distutils.command.build_py import build_py
>  
> +
> +current_version = '%d.%d' % sys.version_info[:2]
> +try:
> +    f = open('GIT-PYTHON_VERSION', 'r')
> +    latest_version = f.read().strip()
> +    f.close()
> +
> +    if latest_version != current_version:
> +        if not '--force' in sys.argv:
> +            sys.argv.insert(0, '--force')
> +except IOError:
> +    pass
> +
> +f = open('GIT-PYTHON_VERSION', 'w')
> +f.write(current_version)
> +f.close()
> +
> +
>  setup(
>      name = 'git_remote_helpers',
>      version = '0.1.0',
> 

That's about the same overhead as doing it in the Makefile,
and a bit more obscure.  I don't mind your initial version
so much anymore.  Thanks for thinking about it.

		-- Pete

^ 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