[git-users] Re: files case name changes detection.
Well, that may work. I shell give it a try. However, I will need to check also the file paths are the the same before denying the push since the file can reside elsewhere as well. Thanks for the tip. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] Re: files case name changes detection.
Bdw, by hook, I meant server side hook, ,not clientI guess that is changing things a bit. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] Can't find any GIT folder on VS2010
Hi, I'm trying to install git on visual studio 2010/W7. I follow these steps : https://gitscc.codeplex.com/wikipage?title=InstallationreferringTitle=Documentation No problem to find git source control in the gallery and install it but when I try to set path to git bash in step 2, I can't find any git folder. I searched everywhere (at least I think) Programs/Programs Files (x86)/User data ... I can find C:\Users...\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Yiyi Sun et. al but still no git folder. Can you help me ? Thanks, Olivier -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] files case name changes detection.
On Tue, 12 Nov 2013 08:11:40 -0800 (PST) Gabby Romano omerik...@gmail.com wrote: I would like to be able to prevent case name changes done on windows clients and being pushed to our linux remote repository. when pulled, it confuses the other windows clients and messes things up. I want to use a hook for that along with the rename detection mechanism of git, if I can call it this way. my question is - what would be the best way to approach this in the hook ? detect the rename and check the content is the same (sha1 check ? ) am I wrong regarding the approach in general and there is a much better way to do this ? I think it's a viable approach though it should be used somewhat differently to what you proposed. Git does not explicitly track file renames so renaming a file (without changing the file's contents) physically looks like a (new) commit indirectly referencing *the same* blob of data as does one of its parent commits, but this blob has a different symbolic name attached to it in one of the tree objects referenced by both commits. In Git, each commit references exactly one tree object (representing the root directory of the project), and that tree object might reference zero or more other tree objects -- one for each top-level subdirectory, and so on and so on going deeper down. Tree objects also reference blobs which contain the data of tracked files. In a tree object, both references to blobs and to other tree objects are decorated with filesystem names for these objects. That's how filesystem hierarchies are mapped to Git objects in its database. As you can see, renames can only be detected by analyzing a part of the commit graph using special algorythms. Fortunately, Git has this machinery implemented for you in its `git diff` command: git diff --name-status --diff-filter=R --find-renames A B should present you with a list or files (along with the Rnnn marker in front of them) which were renamed in commit B compared to commit A. R means Git detected the file has been renamed, and nnn shows you the persentage of the file's contents which remained unchanged (the similarity index; 100% means the file's content hasn't changed). Applying this paradigm in a post-receive hook *might* be more involved since any push operation might update any ref (a branch or a tag) with more than one commit at once -- in a general case with a graph of commits. If you're fine with merely making sure the new tip commit does not introduce any rename compared to the old one, ignoring anything which might have happened in between, just use `git diff` as shown above. If, instead, you want to be sure no commit between A and B introduced a rename, you should employ the fact the command for walking commit graphs, `git log`, is able to use `git diff` machinery for analyzing the commits as it walks. Hence, if we have a ref that is currently pointing to a commit A, and it's about to be updated by the push operation to point to a commit B, we could call git log --oneline --name-status --diff-filter=R --find-renames A..B to list all commits sent to update our ref, which contain renames. Notice that `git diff` is passed the two revisions as a separate arguments, and `git log` receives the rule A..B which means all commits reachable from B excluding all commits reachable from A. I should stress again that there are no renames in Git -- in this VCS this concept is purely synthetic, and so there are knobs to control the algorythm which detects renames. At least you can specify which persentage of the file contents must be *not* changed in a commit to count as a rename. The rationale: in a given commit, a file might be both changed and renamed, and since their contents differ, how do you tell if it's still logically the same file or not? You might tell Git your idea about this -- read the `git diff` manual page about the --find-renames (-M) command-line option. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] .gitignore question
I have some files that I want to ignore but can't seem to come up with the correct format. There are multiple sub-directories with the same path that I want to ignore. Specifically, the are 'someupper path/system/cache' and all start with 'cache.'. The .gitignore entry I am using is: system/cache/cache.* But that does not work. What is the correct syntax to ignore these files? TIA. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] Restricting access to a portion of a repo?
Hi; I'm looking for a way to delegate control of a portion of a repo to a select set of users. Hopefully the scenario will more accurately define the need: I'm setting up a puppet configuration management proof of concept who's configuration files will be managed by git. A specific team should be able to see, modify, and edit web configuration files; but, shouldn't be able to modify or see anything else. In a nutshell, I'm looking for something akin to SVN's access control with which I'm also mostly unfamilliar having set it up for a group of developers only once. Any pointers on where to begin my research would be greatly appreciated. Thanks for your time. Doug O'Leary -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Restricting access to a portion of a repo?
On Wed, Nov 13, 2013 at 3:42 PM, dkoleary dkole...@olearycomputers.com wrote: Hi; I'm looking for a way to delegate control of a portion of a repo to a select set of users. Hopefully the scenario will more accurately define the need: I'm setting up a puppet configuration management proof of concept who's configuration files will be managed by git. A specific team should be able to see, modify, and edit web configuration files; but, shouldn't be able to modify or see anything else. It will be difficult to use a single repo and then allow people to clone it, but only allow them to see parts of it. Split the files into several repos instead, then you can script, or use sub{modules,trees} when you need to bring them all together. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Question on Git Hooks
Thanks Konstantin, and one more quick question? What is the correct way for define the variable in pre-commit hooks in Git bash so I can using those three variables to run git commands, i.e. git show $newrev git merge-base $oldreve $newrev since what I tried in my bash scripts first to define: refname=$1 oldrev=$2 newrev=$3 but when I run check if those three variables are valid first and it doesn't return any value. Thanks Lingfei On Fri, Nov 8, 2013 at 6:29 AM, Konstantin Khomoutov flatw...@users.sourceforge.net wrote: On Thu, 7 Nov 2013 12:14:34 -0500 lingfei ouyang oylf1...@gmail.com wrote: I'm trying to create an Git-extenstion pre-commit hooks and below is what I got: #!/bin/bash -xv refname=$1 oldrev=$2 newrev=$3 pattern=[A-Z]-[0-9]{5}\: echo $newrev newrev_subject=$(git show -s --pretty=format:$s $newrev) echo $newrev_subject if [[ $newrev_subject =~ $pattern ]]; then echo Processing... else echo error: commit subject comment's not include VersionOne stories,defect number exit 1 fi but when I try to commit the changes and I got below output error: C:\Program Files\Git\bin\git.exe commit -F C:\JICore\git-clones\Lingfei_test1\Lingfei_test\.git\\COMMITMESSAGE .git/hooks/pre-commit: line 14: conditional binary operator expected .git/hooks/pre-commit: line 14: syntax error near `=~' .git/hooks/pre-commit: line 14: `if [[ $newrev_subject =~ $pattern ]]; then' Done So could you let me know if anything i did wrong here? Git extentions doesn't know bash? Bash tells you it doesn't understand the token =~ in a place where it expects a binary operator (applicable inside [[ ... ]]). Reading through the bash release notes, I gather than bash acquired this binary operator in version 3.0 (and it has been subsequently further refined in 3.1 and 3.2). Git bash I have installed as part of Git for Windows 1.8.1.2-preview20130201 has the version 3.1.0 (you can know it by hitting Ctrl-x + Ctrl-v while in the Git bash window). So technically the feature should be supported. Though it does not work for me: $ if [[ $x =~ .*b.* ]]; then echo OK; else echo FAIL; fi sh.exe: conditional binary operator expected sh.exe: syntax error near `=~' On a Debian machine running bash 3.2 this works: $ x=abcd1234abcd $ if [[ $x =~ .*a.* ]]; then echo OK; else echo FAIL; fi OK So while I don't know why this binop does not work in Git bash, I'd say just rewrite the script. From `man bash` I gather, than if [[ $s =~ $pattern ]]; then echo OK; fi is roughly the same as if echo $s | grep -q $pattern 2/dev/null; the echo OK; fi Also note that, as indicated by someone else in this thread, a Git hook might be written in any language. The only twist is that on Windows, to be executable, a file must have one of special file name extensions recognised by the system, and a Git hook script must have no extension. The solution to this is to make the hook screen a mere wrapper around some other program which does the actual heavy-lifting. For instance, you might write the hook code in VBS, and then call it in the bootstrap hook script like this (untested): #!/bin/sh exec cscript.exe /b c:/path/to/your/actual/hook/script.vbs -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[git-users] Re: Can't find any GIT folder on VS2010
On Wednesday, November 13, 2013 11:49:25 AM UTC+1, olivier leprêtre wrote: Hi, I'm trying to install git on visual studio 2010/W7. I follow these steps : https://gitscc.codeplex.com/wikipage?title=InstallationreferringTitle=Documentation It looks there like you have to install Git separately. You can get it here: http://msysgit.github.io/ -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] .gitignore question
Can you ignore all subdirectories inside cache directory? If so, just write cache in your .gitignore file. Git will ignore all cache directories independently where it was. It can be in project root or inside a directory. William Seiti Mizuta @williammizuta Caelum | Ensino e Inovação www.caelum.com.br On Wed, Nov 13, 2013 at 11:15 AM, wtriker@gmail.com wrote: I have some files that I want to ignore but can't seem to come up with the correct format. There are multiple sub-directories with the same path that I want to ignore. Specifically, the are 'someupper path/system/cache' and all start with 'cache.'. The .gitignore entry I am using is: system/cache/cache.* But that does not work. What is the correct syntax to ignore these files? TIA. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.