Re: [git-users] “Ghost” commit

2012-09-29 Thread Thiago Rossi
Thank you guys. I was aware only the child knows about the parent, but as 
gitk shows the child. I know in terms of implementation it's only the child 
who knows about its parent. Like the time, there's only the number of 
seconds since 01/01/1970 but we can say day, month, year.

I have just run the suggested command but with a “-unreachable”: git reflog 
expire --all --expire-unreachable=now
Next time I run git prune -n -v it showed me the commit, the tree and the 
blob. What I wanted! :)

I'm not yet sure what would be the difference between git reflog expire 
--all --expire-unreachable=now and git reflog expire 
--expire-unreachable=now but that helped a lot already.

Thank you guys!

On Saturday, 29 September 2012 15:57:28 UTC+1, Konstantin Khomoutov wrote:

 On Fri, 28 Sep 2012 17:55:41 -0700 (PDT) 
 Thiago Rossi thiagor...@gmail.com javascript: wrote: 

 [...] 
  What I don't understand (or see the reasons) is why the blob for the 
  amended commit is not “purge-able”… If it's not listed there, I guess 
  something is referencing to it, and I wonder what, as it seems only 
  reflog is capable of show it. 
 It's not purge-able precisely because the reflog is enabled in your 
 repository (this is the default), and the reflog records all non-linear 
 movenent of branches.  You could also use the terms drastic or 
 catastrophic for such movements -- they are those which would 
 otherwise leave the previous commit a branch pointed at before it 
 moved truly dangling.  When you run `git commit --amend`, you throw 
 away the tip commit of your current branch and replace it with another 
 one -- this is such a drastic movement of a branch.  The reflog keeps a 
 reference to the previous state of a branch, precisely for the reasons 
 of easy recovery, if needed. By default, the reflog keeps its history 
 for 30 days or so. 

 Again, please note that you should not really care about whether Git 
 killed that replaced commit or not, or if that loose commit and the 
 objects it references are dangling and need to be garbage-collected -- 
 this stuff is only to be considered when for some reason you're facing a 
 serious disk space/process memory issue, otherwise a Git repository is 
 self-maintaining: Git will periodically garbage-collect and pack it so 
 there's nothing to worry about.  A disk space/memory issue may occur if, 
 say, someone commits a huge file by mistake, you undo this action and 
 do really want that file to go away *physically* to not waste disk space 
 (which might be an issue when the repo is hosted on a VDS for instance). 
 But this is a special case, and you can combat it with a special tools 
 like `git reflog expire --all --expire=now` followed by 
 `git gc --prune=now` or something like this. 

  If I have 
  A --- B and amend B, now I have 
  A --- C, and B, as far as I know, is no longer listed as a child of 
  A and doesn't have A as a parent. reflog shows B, but who is using B? 
  I am able to checkout B if I know its SHA1 code, and I think it would 
  be a bad idea… I don't know why B can't be purged then. 
 The reflog is using B by referencing it. 
 The rest is as Philip already pointed out: the parent/child relations 
 are reversed in a DVCS system -- it's children who reference their 
 parents, not the other way around.  This will become logical once you 
 recall that commits in a DVCS systems are immutable, so once the commit 
 has been recorded you can't retrofit a reference to a child in it. 
 Hence the implemented scheme is way more flexible: you can add/remove 
 any number of children any time without touching any commits at all. 


-- 
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/-/OvWkFOYGqMUJ.
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: does git http backend work as in the manual?

2012-09-29 Thread Thomas Ferris Nicolaisen
On Saturday, September 29, 2012 1:59:24 AM UTC+2, ghuang wrote:

 following 
 http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html

 I have the anonymous git clone work 

 if I set this

 {{{

 Location /git/private AuthType Basic AuthName Private Git Access 
 Require group committers ... /Location

 }}}
 that seems work.
 but if I following the manual want anonymous download and authenticated write 
 like this
 {{{

 To enable anonymous read access but authenticated write access, require 
 authorization with a LocationMatch directive:
  
 LocationMatch ^/git/.*/git-receive-pack$
 AuthType Basic
 AuthName Git Access
 Require group committers
 ...
 /LocationMatch

 }}}
 seems every time the server got 

 /git/info/refs?service=git-upload-pack HTTP/1.1 401 726 

 because of the question mark in the request uri, the regular expression 
 doesn't work, so it didn't ask me the password and give failure.

 What I really want to do is like this:

 separate user in two groups: dev and user

 anonymous: no access, can not git clone
 user group: can clone, but can not push, both require authentication
 dev group: can clone and push. both require authentication

 I was trying to use 

 LocationMatch ^/git/.*/git-receive-pack$
 and for push 
 and use a 
 LocationMatch ^/git/.*/git-upload-pack$

 for clone. 

 but because of those question mark, it doesn't work

 Does anyone have good solution?



If you're willing to drop using pure Git/Apache, and host a Java webapp, 
you could try Gitblit http://gitblit.com/. It's pretty easy to get 
started with, offers push/pull over http(s), and supports finer access 
control (groups per repository) out of the box.

If you want to stick to pure Git/Linux, I've heard many speak warmly of 
Gitolite https://github.com/sitaramc/gitolite.

-- 
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/-/HjoqkTMAae0J.
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.