Re: [git-users] how to know which file changed since one commit?

2012-07-06 Thread Aneesh Bhasin
On Jul 7, 2012 10:24 AM, "lei yang"  wrote:
>
> Hi Experts,
>
> I want to know which file is changed sine one commit, how could I do?
>
> Thanks
> Lei

git diff --numstat ..HEAD

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] how to know which file changed since one commit?

2012-07-06 Thread lei yang
Hi Experts,

I want to know which file is changed sine one commit, how could I do?

Thanks
Lei

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Marking code blocks consistently ignored for add/commit

2012-07-06 Thread Tim Chase
On 07/06/12 14:07, Les Nightingill wrote:
> is it possible to pull all the test-only pieces of code from a "test_only" 
> file, that is ignored by git. Include the test code in such a way that if 
> the "test_only" file is not present, the production code still holds 
> together.

Because the test code uses the code above, I suspect that would
either create problematic circular imports or would require passing
the entire contents of the module namespace into the debugging
function.  It's also more convenient to have the testing code in the
same file that's being tested, though that's not a deal-breaker.

-tkc


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Marking code blocks consistently ignored for add/commit

2012-07-06 Thread Les Nightingill
is it possible to pull all the test-only pieces of code from a "test_only" 
file, that is ignored by git. Include the test code in such a way that if 
the "test_only" file is not present, the production code still holds 
together.

On Friday, July 6, 2012 11:42:58 AM UTC-7, Tim Chase wrote:
>
> I've got a number of Python modules where the debugging code changes 
> on a regular basis, but is of no relevance to the history of the 
> file.  For a snippet, it might be something like 
>
>  
>   def real_code(x): 
> return do_stuff(x) 
>
>   # version everything above the next line 
>   if __name__ == "__main__":   # everything from here on 
> filename = r"/tmp/thing"   # should be ignored 
> f = real_code(x)   # every time 
> print f["some arbitrary test case"] 
>  
>
> The files are data-source files from providers, and the value I want 
> to check (the subscripting in this case) is usually some case with 
> which we're having a particular problem.  Because it's just there to 
> test new cases in the providers' data, and the tests aren't 
> available in every source data file (we don't keep huge histories of 
> the gigs of files/data to allow retesting later). 
>
> Currently, when I check it in, I do an "add -p" and just skip the 
> hunks after the "if __name__ ==".  I was wondering if there was a 
> better (i.e., automatic) way to delimit that a certain segment of 
> the file should never be considered "changed" and that git should 
> ignore it when adding/committing the file. 
>
> Thanks, 
>
> -tkc 
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/6Nl83a3Zo-sJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Marking code blocks consistently ignored for add/commit

2012-07-06 Thread Tim Chase
I've got a number of Python modules where the debugging code changes
on a regular basis, but is of no relevance to the history of the
file.  For a snippet, it might be something like


  def real_code(x):
return do_stuff(x)

  # version everything above the next line
  if __name__ == "__main__":   # everything from here on
filename = r"/tmp/thing"   # should be ignored
f = real_code(x)   # every time
print f["some arbitrary test case"]


The files are data-source files from providers, and the value I want
to check (the subscripting in this case) is usually some case with
which we're having a particular problem.  Because it's just there to
test new cases in the providers' data, and the tests aren't
available in every source data file (we don't keep huge histories of
the gigs of files/data to allow retesting later).

Currently, when I check it in, I do an "add -p" and just skip the
hunks after the "if __name__ ==".  I was wondering if there was a
better (i.e., automatic) way to delimit that a certain segment of
the file should never be considered "changed" and that git should
ignore it when adding/committing the file.

Thanks,

-tkc



-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread PJ Weisberg
On Fri, Jul 6, 2012 at 3:55 AM, lem torov  wrote:
> i was using netbeans ide and as CVS i was using git included into IDE.
>
> once i lanch standalone git-msys in my project directory
> git branch
> showed me
> * no branch
>   master
>   you are not in any branch
>
> i did
> git checkout master
> and i lost like 5 weeks of my work. if there is any way to restore it?

If I was a jerk, I would give you the accurate-but-unhelpful advice
that you should run the command Git told you to run in the warning
message it printed when you did 'git checkout master'.

If I was trying to be helpful I might try to teach you what a detached
HEAD is and what the reflog does, but that misses the fact that you're
panicking about losing five weeks worth of work and not interested in
learning anything until you've found it again.

So I'll give you a step-by-step:

$ git checkout master
Because I'm assuming you want these commits you're trying to
recover to be on the 'master' branch.
$ git reflog
Look in the output for the commit message of the last change
to the branch you're trying to restore
$ git reset --merge abc123
Here, 'abc123' is the sha1 of the commit you noted in the
previous step.  You can replace '--merge' with '--hard' if there are
no changes in your current working directory that you want to
preserve, but I'm recommending the safer option for people who find
this post on Google in the future. :-)

That will leave the 'master' branch pointing at the commit 'abc123'.
(In Git, branches and tags are simply pointers to specific commits.)

Now in the future, if you 'checkout' anything other than a branch,
remember to 'checkout' a branch again before you commit anything you
want to keep!

-PJ

Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: How to add the branch from another tree to my local branch

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 23:17:01 +0800
lei yang  wrote:

[...]
> > 1) Make a certain branch from a certain (remote) repository to
> > appear in your local repository.
> 
> Yes this one,make the branch from remote to be as my local branch
This is simple.
But the steps to perform depend on what you really need to achieve.

If you just want a one-off action, that is, to bring that branch to your
local repo as it looks now and then do not ever touch it--I mean, you do
not want to follow any remote changes which that branch might receive in
the future--then you can just use the so-called "refspec" with the `git
fetch` command:

$ git fetch  refs/heads/thatbranch:refs/heads/thisbranch

will create the branch named "thisbranch" in your local repository, and
this branch will have the history of the branch "thatbranch" from the
remote repository .  This remote might be a "named
remote" (that is, created previously with the `git remote add` command)
or just an URL (as used with the `git clone` command).
More info on this is in the `git fetch` manual page, as usually.

If you want instead to actually track the developments on that branch
after you bring it to your repository, you should take the route
described in [1] and [2], that is, add a named remote, fetch from it
(this will create the so-called "remote-tracking branches" for that
remote's branches in your local repository) and then optionally fork
your own local branches off those remote-tracking branches.

1. http://git-scm.com/book/en/Git-Basics-Working-with-Remotes
2. http://git-scm.com/book/en/Git-Branching-Remote-Branches

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: The commit share

2012-07-06 Thread lei yang
I'm on the train with my phone,tomrrow I would give you example.

On Friday, July 6, 2012, Thomas Ferris Nicolaisen wrote:

> Hi,
>
> Could you explain what you mean with "*the shared commit id since the
> commitid1 for the two branch*"? Perhaps provide an example?
>
> On Friday, July 6, 2012 2:39:44 PM UTC+2, lei yang wrote:
>>
>>  Hi expert,
>>
>> With git merge-base I get the commitid1 for the merge base . How could I
>> get the shared commit id since the commitid1 for the two branch?
>>
>> Thanks
>> Lei
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/git-users/-/ZxRa-Ga7v_cJ.
> To post to this group, send email to 
> git-users@googlegroups.com 'git-users@googlegroups.com');>
> .
> To unsubscribe from this group, send email to
> git-users+unsubscr...@googlegroups.com  'git-users%2bunsubscr...@googlegroups.com');>.
> For more options, visit this group at
> http://groups.google.com/group/git-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: How to add the branch from another tree to my local branch

2012-07-06 Thread lei yang
On Friday, July 6, 2012, Konstantin Khomoutov wrote:

> On Fri, 6 Jul 2012 20:34:34 +0800
> lei yang > wrote:
>
> > As the title, thanks in advance
> Please try to rephrase as it appears you're using wrong terminology.
>
> A tree is a collection of files.  For instance, each commit refers to a
> tree which captures the state of files that commit refers to.
> Hence the statement "a branch from another tree" has no sence: trees do
> not have branches, repositories do.
> So did you mean branch instead?
>
> Next, what do you mean by using the "add ... branch .. to ... branch"
> statement?  You can't "add" two branches, this has no sense.
> Did you mean merging?  Or what?
>
> I can try to guess you wanted one of these:
> 1) Make a certain branch from a certain (remote) repository to appear in
>your local repository.


Yes this one,make the branch from remote to be as my local branch



> 2) Merge a certain branch from a certain (remote) repository with one
>of the branches in your local repository?
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: git clone fails "with error: RPC failed; result=22, HTTP code = 401

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 07:27:36 -0700 (PDT)
Thomas Ferris Nicolaisen  wrote:

> I think this is a bit on the advanced side of things we usually
> answer on this list, so you could try asking on the git development
> list (described here ).
He already did that.
Mentioning the fact of cross-posting seems to be a lost art from the
long-forgotten Usenet times.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: git clone fails "with error: RPC failed; result=22, HTTP code = 401

2012-07-06 Thread Thomas Ferris Nicolaisen
Hi,

I think this is a bit on the advanced side of things we usually answer on 
this list, so you could try asking on the git development list (described 
here ).

On Friday, July 6, 2012 2:11:17 PM UTC+2, Ilya wrote:
>
> Hi all,
>
> following enviroment:
>
> stock debian squeeze + apache2 + gitweb.
> Apache handles user authentication over ldap.
>
>
> the apache git-related config is:
>
>
> ---
> (taken from the
> http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html)
>
> [...]
> SetEnv GIT_PROJECT_ROOT /mnt/system/git
>
> AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/
> [0-9a-f]{38})$
> /mnt/system/git/$1
> AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$
> /mnt/system/git/$1
> ScriptAliasMatch \
> "(?x)^/git/(.*/(HEAD | \
> info/refs | \
> objects/info/[^/]+ | \
> git-(upload|receive)-pack))$" \
> /usr/lib/git-core/git-http-backend/$1
> ScriptAlias /git/ /usr/lib/cgi-bin/gitweb.cgi/
>
> [...]
> 
> # read access
> 
> require ldap-group repo.writers
> require ldap-group repo.readers
> 
>
> # write access
>  LOCK UNLOCK>
> require ldap-group repo.writers
> 
>
> 
> --
>
> The ldap group "repo.writers" has "repo.writer" user in it.
> The ldap group "repo.readers" has "repo.reader" user in it.
>
> Using the "repo.writer" User, i can successfully clone the repo / push
> into the repo.
> The appropriate apache-log entries are:
>
> 
> 10.13.99.59 - - [06/Jul/2012:13:28:57 +0200] "GET
> /git/repo1.git/info/refs?service=git-receive-pack HTTP/1.1" 401 2427
> "-" "git/1.7.2.5"
> 10.13.99.59 - repo.writer [06/Jul/2012:13:28:57 +0200] "GET
> /git/repo1.git/info/refs?service=git-receive-pack HTTP/1.1" 200 728
> "-" "git/1.7.2.5"
> 10.13.99.59 - repo.writer [06/Jul/2012:13:28:57 +0200] "POST
> /git/repo1.git/git-receive-pack HTTP/1.1" 200 754 "-" "git/1.7.2.5"
> 
>
> But if i try to use the "repo.reader" account to CLONE the repo, then it 
> fails:
>
> output@shell:
> 
> ilya@brick:/tmp $ git clone https://repo.reader@git-host/git/repo1.git
> Cloning into repo1...
> Password:
> error: RPC failed; result=22, HTTP code = 401
> fatal: The remote end hung up unexpectedly
> ilya@brick:
> 
>
>
> output@apache-logs
> 
> 10.13.99.59 - - [06/Jul/2012:13:28:13 +0200] "GET
> /git/repo1.git/info/refs?service=git-upload-pack HTTP/1.1" 401 2427
> "-" "git/1.7.2.5"
> 10.13.99.59 - repo.reader [06/Jul/2012:13:28:13 +0200] "GET
> /git/repo1.git/info/refs?service=git-upload-pack HTTP/1.1" 200 935 "-"
> "git/1.7.2.5"
> 10.13.99.59 - repo.reader [06/Jul/2012:13:28:13 +0200] "POST
> /git/repo1.git/git-upload-pack HTTP/1.1" 401 894 "-" "git/1.7.2.5"
> 
>
> The reason why the cloning fails is pretty clear
>
> 1. the repo.reader is trying to "POST /git/repo1.git/git-upload-pack",
> 2. accordingly the rule "" for "writers" is matching,
> 3. apache makes a lookup into LDAP and OF COURSE cannot fint the
> "repo.reader"-User in the group "repo.writers"
> 4. as a result the 401 is replied by apache.
>
> When i put the "repo.reader" user into the "repo.writers"-group, then,
> of course, he can clone the repo.
> But then he also can push into the repo...
>
>
> The question is now - why, damn, the git client is trying to post
> something on CLONE!??!
>
> And the second question - how do i solve it?
>
>
> I need the authenticated read / authenticated writes separation.
>
>
> Thanks in advance!
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/Bp0ELv_93j4J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: The commit share

2012-07-06 Thread Thomas Ferris Nicolaisen
Hi, 

Could you explain what you mean with "*the shared commit id since the 
commitid1 for the two branch*"? Perhaps provide an example?

On Friday, July 6, 2012 2:39:44 PM UTC+2, lei yang wrote:
>
>  Hi expert,
>
> With git merge-base I get the commitid1 for the merge base . How could I 
> get the shared commit id since the commitid1 for the two branch?
>
> Thanks
> Lei
>  

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/ZxRa-Ga7v_cJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] How to add the branch from another tree to my local branch

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 20:34:34 +0800
lei yang  wrote:

> As the title, thanks in advance
Please try to rephrase as it appears you're using wrong terminology.

A tree is a collection of files.  For instance, each commit refers to a
tree which captures the state of files that commit refers to.
Hence the statement "a branch from another tree" has no sence: trees do
not have branches, repositories do.
So did you mean branch instead?

Next, what do you mean by using the "add ... branch .. to ... branch"
statement?  You can't "add" two branches, this has no sense.
Did you mean merging?  Or what?

I can try to guess you wanted one of these:
1) Make a certain branch from a certain (remote) repository to appear in
   your local repository.
2) Merge a certain branch from a certain (remote) repository with one
   of the branches in your local repository?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] Re: git erase everything

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 05:07:16 -0700 (PDT)
lem torov  wrote:

> As do understand git copies all files into .git/objects folder and
> all this files compressed so i cant use grep to find files which i
> need. if there tools to view tree of commits and files include losted
> commits so i can recover everything manually. i need at list to find
> one latest build jar file so i can diassembly it and recover my work.
I recommend you to calm down and get hold onto that reflog concept.
You did not lost your work if you did commit it.  You just need to
deduce the correct ex-HEAD commit from the `git reflog` output of your
repo.

By the way, if you need a quick assistance consider joining the Git's
IRC channel--chances are good there will be someone to help you
through the recovery process.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 04:42:07 -0700 (PDT)
lem torov  wrote:

[...]
> > And to get hold of this "detached HEAD" concept, read this: 
> > http://sitaramc.github.com/concepts/detached-head.html 
> 
> if there are desctiption how to into not in branch. If I do have a
> single branch. How do I get out of it. I mean when i run 
> *git branch *
> i was getting  output that i am in branch "* no branch", but if i try 
> *git checkout no branch*
> result is *such branch doesnot exist.*
The `git branch` lists the branches present in your repository and marks
the currently checked out branch using the asterisk sign ("*").
It also ought to have a way to somehow indicate that what's currently
checked out does not belong to any branch.  So it does this by printing
"no branch".  If you think that's incorrect/inconvenient/confusing or
whatever else feel free to summarise your ideas on the main Git list
(git at vger.kernel.org).

> how i could possible to get in there.
The ways to get into that state are well explained in the tutorial
I linked to.  But note that your IDE is another factor to consider.

> in fact now i did as it was proposed and i did checked out commit
> preceding time when i did destroyed repo into branch "recover". and
> them i did *git checkout recover
> *nothing happend. there are no files which suppose to be in where.
> and I did today 2 commits.*
You hasn't been told to "check out a commit from preceeding time",
it was proposed that you inspect the output of `git reflog` carefully
(*after* reading a suitable guide on what the reflog shows you and how
to interpret that info) and then try to figure out what reflog entry
points to the commit you HEAD pointed to before you moved it by
checking out an existing branch.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] The commit share

2012-07-06 Thread lei yang
 Hi expert,

With git merge-base I get the commitid1 for the merge base . How could I
get the shared commit id since the commitid1 for the two branch?

Thanks
Lei

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 05:01:55 -0700 (PDT)
lem torov  wrote:

> > > I follow you tutorial 
> > Actually, I gather that this more modern guide [1] written by the
> > same author is indeed better (linked from the original tutorial). 
> >
> > 1. 
> > http://sitaramc.github.com/gcs/index.html#gcs_index_detached_HEAD_and_all_that_
> >  
> >
> 
> question is not "what is head"  or "what is detached head". question
> is how did i get into "no branch" branch. why there is no any notice
> when i did commit into no branch.
> and if commits are registered why those commits doesnot contain files
> which i did commit into it.

In your original mail you stated:
"i was using netbeans ide ..."
hence the only sensible answer to the first two questions is "ask
netbeans folks".

With plain Git, there are several ways to get into the detached HEAD
state; they are all summarised in the article I referred to.

Making a wild guess, I suspect that your IDE allowed you to check out a
remote branch or a tag.

The last question is more tricky.  One possibility is that your guess
about what commit the HEAD was pointing to before you checked out a
branch was wrong.  Try looking at your reflog more carefully, make
temporary tags or branches out of any commits you think might be the
correct lost HEAD and inspect them one by one until you find the right
one.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] How to add the branch from another tree to my local branch

2012-07-06 Thread lei yang
As the title, thanks in advance

Lei

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] git clone fails "with error: RPC failed; result=22, HTTP code = 401

2012-07-06 Thread Ilya
Hi all,

following enviroment:

stock debian squeeze + apache2 + gitweb.
Apache handles user authentication over ldap.


the apache git-related config is:


---
(taken from the
http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html)

[...]
SetEnv GIT_PROJECT_ROOT /mnt/system/git

AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/
[0-9a-f]{38})$
/mnt/system/git/$1
AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$
/mnt/system/git/$1
ScriptAliasMatch \
"(?x)^/git/(.*/(HEAD | \
info/refs | \
objects/info/[^/]+ | \
git-(upload|receive)-pack))$" \
/usr/lib/git-core/git-http-backend/$1
ScriptAlias /git/ /usr/lib/cgi-bin/gitweb.cgi/

[...]

# read access

require ldap-group repo.writers
require ldap-group repo.readers


# write access

require ldap-group repo.writers



--

The ldap group "repo.writers" has "repo.writer" user in it.
The ldap group "repo.readers" has "repo.reader" user in it.

Using the "repo.writer" User, i can successfully clone the repo / push
into the repo.
The appropriate apache-log entries are:


10.13.99.59 - - [06/Jul/2012:13:28:57 +0200] "GET
/git/repo1.git/info/refs?service=git-receive-pack HTTP/1.1" 401 2427
"-" "git/1.7.2.5"
10.13.99.59 - repo.writer [06/Jul/2012:13:28:57 +0200] "GET
/git/repo1.git/info/refs?service=git-receive-pack HTTP/1.1" 200 728
"-" "git/1.7.2.5"
10.13.99.59 - repo.writer [06/Jul/2012:13:28:57 +0200] "POST
/git/repo1.git/git-receive-pack HTTP/1.1" 200 754 "-" "git/1.7.2.5"


But if i try to use the "repo.reader" account to CLONE the repo, then it 
fails:

output@shell:

ilya@brick:/tmp $ git clone https://repo.reader@git-host/git/repo1.git
Cloning into repo1...
Password:
error: RPC failed; result=22, HTTP code = 401
fatal: The remote end hung up unexpectedly
ilya@brick:



output@apache-logs

10.13.99.59 - - [06/Jul/2012:13:28:13 +0200] "GET
/git/repo1.git/info/refs?service=git-upload-pack HTTP/1.1" 401 2427
"-" "git/1.7.2.5"
10.13.99.59 - repo.reader [06/Jul/2012:13:28:13 +0200] "GET
/git/repo1.git/info/refs?service=git-upload-pack HTTP/1.1" 200 935 "-"
"git/1.7.2.5"
10.13.99.59 - repo.reader [06/Jul/2012:13:28:13 +0200] "POST
/git/repo1.git/git-upload-pack HTTP/1.1" 401 894 "-" "git/1.7.2.5"


The reason why the cloning fails is pretty clear

1. the repo.reader is trying to "POST /git/repo1.git/git-upload-pack",
2. accordingly the rule "" for "writers" is matching,
3. apache makes a lookup into LDAP and OF COURSE cannot fint the
"repo.reader"-User in the group "repo.writers"
4. as a result the 401 is replied by apache.

When i put the "repo.reader" user into the "repo.writers"-group, then,
of course, he can clone the repo.
But then he also can push into the repo...


The question is now - why, damn, the git client is trying to post
something on CLONE!??!

And the second question - how do i solve it?


I need the authenticated read / authenticated writes separation.


Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/GwQFnyofX6cJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: git erase everything

2012-07-06 Thread lem torov
As do understand git copies all files into .git/objects folder and all this 
files compressed so i cant use grep to find files which i need.
if there tools to view tree of commits and files include losted commits so 
i can recover everything manually. i need at list to find one latest build 
jar file so i can diassembly it and recover my work.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/1gp2_aF10H8J.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread lem torov


пятница, 6 июля 2012 г., 15:45:25 UTC+4 пользователь Konstantin Khomoutov 
написал:
>
>
> > I follow you tutorial 
> Actually, I gather that this more modern guide [1] written by the same 
> author is indeed better (linked from the original tutorial). 
>
> 1. 
> http://sitaramc.github.com/gcs/index.html#gcs_index_detached_HEAD_and_all_that_
>  
>

question is not "what is head"  or "what is detached head". question is how 
did i get into "no branch" branch. why there is no any notice when i did 
commit into no branch.
and if commits are registered why those commits doesnot contain files which 
i did commit into it.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/z8Lqra5zFJAJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 04:29:45 -0700 (PDT)
lem torov  wrote:

> I follow you tutorial
Actually, I gather that this more modern guide [1] written by the same
author is indeed better (linked from the original tutorial).

1. 
http://sitaramc.github.com/gcs/index.html#gcs_index_detached_HEAD_and_all_that_

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread lem torov


пятница, 6 июля 2012 г., 15:18:39 UTC+4 пользователь Konstantin Khomoutov 
написал:
>
>
> > i was using netbeans ide and as CVS i was using git included into IDE. 
> > 
> > once i lanch standalone git-msys in my project directory 
> > git branch 
> > showed me 
> > ** no branch 
> >   master 
> >   you are not in any branch 
> > * 
> > i did 
> > *git checkout master* 
> > and i lost like 5 weeks of my work. if there is any way to restore it? 
>
> Follow the advice given by Aneesh. 
>
> And to get hold of this "detached HEAD" concept, read this: 
> http://sitaramc.github.com/concepts/detached-head.html 
>

if there are desctiption how to into not in branch. If I do have a single 
branch. How do I get out of it. I mean when i run 
*git branch *
i was getting  output that i am in branch "* no branch", but if i try 
*git checkout no branch*
result is *such branch doesnot exist.*
how i could possible to get in there.

in fact now i did as it was proposed and i did checked out commit preceding 
time when i did destroyed repo into branch "recover". and them i did 
*git checkout recover
*nothing happend. there are no files which suppose to be in where. and I 
did today 2 commits.*
*

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/Txsi5TnNqPQJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread lem torov
I follow you tutorial

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/8oh273MuSMoJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 03:55:03 -0700 (PDT)
lem torov  wrote:

> i was using netbeans ide and as CVS i was using git included into IDE.
> 
> once i lanch standalone git-msys in my project directory
> git branch
> showed me
> ** no branch
>   master
>   you are not in any branch
> *
> i did 
> *git checkout master*
> and i lost like 5 weeks of my work. if there is any way to restore it?

Follow the advice given by Aneesh.

And to get hold of this "detached HEAD" concept, read this:
http://sitaramc.github.com/concepts/detached-head.html

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git erase everything

2012-07-06 Thread Aneesh Bhasin
Hi Lem,

On Fri, Jul 6, 2012 at 4:25 PM, lem torov  wrote:
>
> i was using netbeans ide and as CVS i was using git included into IDE.
>
> once i lanch standalone git-msys in my project directory
> git branch
> showed me
> * no branch
>   master
>   you are not in any branch
>
> i did
> git checkout master
> and i lost like 5 weeks of my work. if there is any way to restore it?
>

'git reflog' is your friend. Try this command - it should show your
where the HEAD pointed to in last few operations. Using it you should
be able to figure out the commit id of the tip of the dangling branch
you were earlier on.
Once you have the commit id, just do:

git checkout -b my_old_branch 

This will create a new 'my_old_branch' pointing to that commit...

regards,
Aneesh

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] git erase everything

2012-07-06 Thread lem torov
i was using netbeans ide and as CVS i was using git included into IDE.

once i lanch standalone git-msys in my project directory
git branch
showed me
** no branch
  master
  you are not in any branch
*
i did 
*git checkout master*
and i lost like 5 weeks of my work. if there is any way to restore it?




-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/q1dJ9RwnbVUJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



Re: [git-users] git push fine, git pull not seeing changed

2012-07-06 Thread Konstantin Khomoutov
On Fri, 6 Jul 2012 01:40:56 -0700 (PDT)
Avner Tamir  wrote:

> we are facing a strange problems:
> when we push to remote repo code is pushed successfully and we do see
> the commits and code being pushed via gitweb.
> when we try to pull from remote repo, we are getting a message "all
> up to date" but we do not see new code.
> to make things more interesting we do see on client machine that HEAD
> is pointing to the right commit.
> we are using http, our repo is on apache (httpd), OS is RHEL 5.7
Isn't this a standard problem with not running an appropriate hook
after pushing?  See the "My HTTP repository has updates, which git clone
misses. What happened?" question in the FAQ [1].

1. https://git.wiki.kernel.org/index.php/GitFaq

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] git push fine, git pull not seeing changed

2012-07-06 Thread Avner Tamir
Hi,

we are facing a strange problems:
when we push to remote repo code is pushed successfully and we do see the 
commits and code being pushed via gitweb.
when we try to pull from remote repo, we are getting a message "all up to 
date" but we do not see new code.
to make things more interesting we do see on client machine that HEAD is 
pointing to the right commit.
we are using http, our repo is on apache (httpd), OS is RHEL 5.7

Thanks in advance,
Avner Tamir  

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/Lod7dmxLsfAJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: git does not update on OSX 10.6

2012-07-06 Thread Thomas Ferris Nicolaisen
On Friday, July 6, 2012 8:43:59 AM UTC+2, dmanexe wrote:
>
> I've been using the installer from the Google Code page but it dosen't 
> update my git from 1.7.3.4 to 1.7.11.1. I've ran the installer package, 
> logged out, but it doesn't update. What am I doing wrong?


Sounds like you have another Git installation which is before the new on in 
your $PATH.

See this 
thread: https://groups.google.com/d/topic/git-users/I-XYgdWuKnM/discussion 

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/git-users/-/njrMaWO3MYMJ.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.