Re: [git-users] How to make sharing directories instead of duplicating?
On Thu, 25 Sep 2014 07:54:39 -0700 (PDT) Віктор Невідомий wrote: > Very good explanation. It clarifies something. I read some comments > about using "subtree" vs "submodules". In most places people give a > bad score to "submodules". I dunno. Both are well supported, and IMO submodules is usually touted as a goto solution for cases like yours. By the way, another feature submodules have over subtree merging is that it's easier to play with different states of subprojects: say, it's easy to see how the whole project would behave if all the subprojects are in their most recent states while a single subproject is, say, in a state it was two months ago. This should be doable with subtree merging as well, but I think it will be somewhat tricky to achieve. Another perspective which might be useful to you is that if you're familiar with Subversion, submodules are like Subversion's "externals" anchored at concrete revisions. -- 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/d/optout.
Re: [git-users] git grep find files containaing A AND NOT B (in all lines)
git grep -l --all-match -e A --and --not -e B gives me files containing A and containing B or not ... Le jeudi 25 septembre 2014 16:44:33 UTC+2, iv a écrit : > > of course, "-l" gives you name only... > > Le jeudi 25 septembre 2014 16:11:34 UTC+2, Magnus Therning a écrit : >> >> On Thu, Sep 25, 2014 at 06:38:49AM -0700, iv wrote: >> > hi, >> > does anyone know how to grep simply files containing pattern A and not >> pattern B in all the lines... >> > this doesn't work: >> > git grep -l --all-match -e A --and --not -e B >> > >> > git version 2.1.0 >> >> That seems to work fine for me on 2.1.1. >> >> I'm guessing you've removed the `-l` to verify the matches, right? >> >> /M >> >> -- >> Magnus Therning OpenPGP: 0xAB4DFBA4 >> email: mag...@therning.org jabber: mag...@therning.org >> twitter: magthe http://therning.org/magnus >> >> The results point out the fragility of programmer expertise: advanced >> programmers have strong expectations about what programs should look >> like, >> and when those expectations are violated--in seemingly innocuous >> ways--their performance drops drastically. >> -- Elliot Soloway and Kate Ehrlich >> > -- 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/d/optout.
Re: [git-users] How to make sharing directories instead of duplicating?
Very good explanation. It clarifies something. I read some comments about using "subtree" vs "submodules". In most places people give a bad score to "submodules". Четвер, 25 вересня 2014 р. 17:05:21 UTC+3 користувач Konstantin Khomoutov написав: > > On Thu, 25 Sep 2014 04:28:16 -0700 (PDT) > Віктор Невідомий > wrote: > > > > you have to turn each of these directories into separate > > > repositories and either use the so-called "subtree merging" or > > > submodules. > > > > I was going to do so. Maybe it was not clear from my scheme in > > original question. I edited it to clarify. > > > > Proj1_2_common/ > > .git/ > > ... > > Proj1_2_3_common/ > > .git/ > > ... > > Proj1/ > > .git/ > > > > And after this again: what is advantages of "subtree" or "submodules" > > over just add "Proj1_2_common/" to project in IDE and use it repo > > separately? > > Ah, I see now, thanks. > > The problem with simply adding them all into an IDE project is that > tracking that project's history with Git (I mean, tracking the files > comprising what constitutes a project in your IDE, such as .sln and a > set of *.csproj files for an C#/.NET application, and may be also some > code files etc) will produce a series of commits which, themselves, > contain no record of which exact states all of the referenced > subprojects were in when that commit has been recorded. > > Let me try to explain that in more words. > > Suppose you did what you intended, and just slapped a bunch of > git-clone'd projects under a single directory, and added references > to the files in them to your IDE's project. So far so good. > Now some time passes and some of those referenced projects get updated. > You'll typically `cd` into each of the referenced projects and do > `git pull` (or may be something more appropriate) there -- to bring the > latest changes in. You will then possibly make some adjustments to your > "superproject" and commit these changes. > > Now you see that should you have the need to check out some *past* > revision of your superproject (maybe during `git bisect` or to just > fork a branch off some prior state etc), you'll discover that the > commit you're about to check out has no idea about which precise states > of the subprojects it references have been checked out when that commit > has been recorded. That happens because the synthetic state of all the > checked out projects was "ad hoc", and was never recorded anywhere, > anyhow. > > Enter subtree merging or submodules. > > With subtree merging, you have histories of subprojects recorded in > your repository. You merge (and later re-merge) their new state > into your superproject from time to time, and hence any commit you > record "on the top level" -- for the files comprising the superproject > itself -- automatically references the correct states of all the > subprojects -- because they're in the same repository. > > With submodules, your superproject maintains a list of submodules, > and each commit recorded in the superproject records SHA-1 names > of the commits currently checked out in each submodule at the time > the commit is created. > > Hence, with either approach, when you later check any of your past > revisions of the superproject, the exact state of the whole thing is > reconstructed. > > Pros and cons of these approaches are: > Subtree merging has everything in the single repository: > easier to carry around and view the history. > But this comes at the cost of having the histories > of the subproject in the superproject's repository. > Submodules require accessing other repos when you clone > the superproject and hence the superproject's repo is not > free-standing. On the other hand, there is no history duplication. > > > And what about history of old and new repos? > > Either approach will make histories of subprojects available > when working on the superproject, though via different means. > > Of course, you will have a single point in the history of your > superproject where you will have started using either of the > approaches explained above. If you want to somehow retrofit past > states of the subproject's histories intertwined with certain past > states of the superproject this is another task completely and, > while supposedly doable, this will be hard and tedious and manual > to get done. > > > it still would be better if you have copied the original answer inline > > Only answer without question? > > My bad: I meant question. > -- 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/d/optout.
Re: [git-users] git grep find files containaing A AND NOT B (in all lines)
of course, "-l" gives you name only... Le jeudi 25 septembre 2014 16:11:34 UTC+2, Magnus Therning a écrit : > > On Thu, Sep 25, 2014 at 06:38:49AM -0700, iv wrote: > > hi, > > does anyone know how to grep simply files containing pattern A and not > pattern B in all the lines... > > this doesn't work: > > git grep -l --all-match -e A --and --not -e B > > > > git version 2.1.0 > > That seems to work fine for me on 2.1.1. > > I'm guessing you've removed the `-l` to verify the matches, right? > > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: mag...@therning.orgjabber: mag...@therning.org > > twitter: magthe http://therning.org/magnus > > The results point out the fragility of programmer expertise: advanced > programmers have strong expectations about what programs should look like, > and when those expectations are violated--in seemingly innocuous > ways--their performance drops drastically. > -- Elliot Soloway and Kate Ehrlich > -- 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/d/optout.
Re: [git-users] git grep find files containaing A AND NOT B (in all lines)
On Thu, Sep 25, 2014 at 06:38:49AM -0700, iv wrote: > hi, > does anyone know how to grep simply files containing pattern A and not > pattern B in all the lines... > this doesn't work: > git grep -l --all-match -e A --and --not -e B > > git version 2.1.0 That seems to work fine for me on 2.1.1. I'm guessing you've removed the `-l` to verify the matches, right? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus The results point out the fragility of programmer expertise: advanced programmers have strong expectations about what programs should look like, and when those expectations are violated--in seemingly innocuous ways--their performance drops drastically. -- Elliot Soloway and Kate Ehrlich pgpM6YKv2Lyf4.pgp Description: PGP signature
Re: [git-users] How to make sharing directories instead of duplicating?
On Thu, 25 Sep 2014 04:28:16 -0700 (PDT) Віктор Невідомий wrote: > > you have to turn each of these directories into separate > > repositories and either use the so-called "subtree merging" or > > submodules. > > I was going to do so. Maybe it was not clear from my scheme in > original question. I edited it to clarify. > > Proj1_2_common/ > .git/ > ... > Proj1_2_3_common/ > .git/ > ... > Proj1/ > .git/ > > And after this again: what is advantages of "subtree" or "submodules" > over just add "Proj1_2_common/" to project in IDE and use it repo > separately? Ah, I see now, thanks. The problem with simply adding them all into an IDE project is that tracking that project's history with Git (I mean, tracking the files comprising what constitutes a project in your IDE, such as .sln and a set of *.csproj files for an C#/.NET application, and may be also some code files etc) will produce a series of commits which, themselves, contain no record of which exact states all of the referenced subprojects were in when that commit has been recorded. Let me try to explain that in more words. Suppose you did what you intended, and just slapped a bunch of git-clone'd projects under a single directory, and added references to the files in them to your IDE's project. So far so good. Now some time passes and some of those referenced projects get updated. You'll typically `cd` into each of the referenced projects and do `git pull` (or may be something more appropriate) there -- to bring the latest changes in. You will then possibly make some adjustments to your "superproject" and commit these changes. Now you see that should you have the need to check out some *past* revision of your superproject (maybe during `git bisect` or to just fork a branch off some prior state etc), you'll discover that the commit you're about to check out has no idea about which precise states of the subprojects it references have been checked out when that commit has been recorded. That happens because the synthetic state of all the checked out projects was "ad hoc", and was never recorded anywhere, anyhow. Enter subtree merging or submodules. With subtree merging, you have histories of subprojects recorded in your repository. You merge (and later re-merge) their new state into your superproject from time to time, and hence any commit you record "on the top level" -- for the files comprising the superproject itself -- automatically references the correct states of all the subprojects -- because they're in the same repository. With submodules, your superproject maintains a list of submodules, and each commit recorded in the superproject records SHA-1 names of the commits currently checked out in each submodule at the time the commit is created. Hence, with either approach, when you later check any of your past revisions of the superproject, the exact state of the whole thing is reconstructed. Pros and cons of these approaches are: Subtree merging has everything in the single repository: easier to carry around and view the history. But this comes at the cost of having the histories of the subproject in the superproject's repository. Submodules require accessing other repos when you clone the superproject and hence the superproject's repo is not free-standing. On the other hand, there is no history duplication. > And what about history of old and new repos? Either approach will make histories of subprojects available when working on the superproject, though via different means. Of course, you will have a single point in the history of your superproject where you will have started using either of the approaches explained above. If you want to somehow retrofit past states of the subproject's histories intertwined with certain past states of the superproject this is another task completely and, while supposedly doable, this will be hard and tedious and manual to get done. > it still would be better if you have copied the original answer inline > Only answer without question? My bad: I meant question. -- 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/d/optout.
[git-users] git grep find files containaing A AND NOT B (in all lines)
hi, does anyone know how to grep simply files containing pattern A and not pattern B in all the lines... this doesn't work: git grep -l --all-match -e A --and --not -e B git version 2.1.0 thank you -- 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/d/optout.
Re: [git-users] How to make sharing directories instead of duplicating?
On Thu, Sep 25, 2014 at 12:50:56PM +0400, Konstantin Khomoutov wrote: > On Thu, 25 Sep 2014 00:08:24 -0700 (PDT) > Віктор Невідомий wrote: > > > Hello. I have some question about advanced git usage. I ask it > > on stackoverflow, but receive only one not very extensive answer. I > > post only link to avoid duplicating question here. > > http://stackoverflow.com/questions/25991234/git-how-to-make-sharing-directories-instead-of-duplicating/ > > Please help me. > > You can't get a better answer: in Git, directories mean nothing to > the VCS, and if you need to share them across different projects, > you have to turn each of these directories into separate > repositories and either use the so-called "subtree merging" or > submodules. Both concepts are explained in any decent book on Git > (including [1]). Another option is to use a tool made to handle a setup with multiple git repositories, like google repo[1], mr[2]. I'm sure there are others. /M [1]: https://code.google.com/p/git-repo/ [2]: http://myrepos.branchable.com/ -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus Code as if whoever maintains your program is a violent psychopath who knows where you live. -- Anonymous pgpeXTlhY_Vfy.pgp Description: PGP signature
Re: [git-users] How to make sharing directories instead of duplicating?
> > you have > to turn each of these directories into separate repositories and > either use the so-called "subtree merging" or submodules. I was going to do so. Maybe it was not clear from my scheme in original question. I edited it to clarify. Proj1_2_common/ .git/ ... Proj1_2_3_common/ .git/ ... Proj1/ .git/ ... Proj2/ .git/ ... Proj3/ .git/ ... And after this again: what is advantages of "subtree" or "submodules" over just add "Proj1_2_common/" to project in IDE and use it repo separately? And what about history of old and new repos? it still would be better if you have copied the original answer inline Only answer without question? -- 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/d/optout.
[git-users] commit with git gui on windows very slow when using with an account i am not logged into windows (hooks ?)
Hello humans, I have just a litte problem with my windows setup in my company, which is annoying enough to ask for help here. *Setup:* I am using Git-1.9.4-preview20140815.exe and I am running my development environment (Console, Editor) with a user who I am not logged in into windows, but has Admin rights. The user I am logged in has no admin rights on my machine. OS is Windows7 SP1 64bit *Problem:* Commandline Git just works fine with both accounts. Git gui works fine when run under my first account. *Commiting *with *Git Gui* is very slow when run under my *second admin account*. (almost 1 minute) In the window there a messages displayed calling pre-commit-hook calling commit-message-hook When I am logged into windows with this account commiting with git gui work fine, too/ I have just deinstalled git and installed it while logged with my admin account, but the problem stays with me. If anyone can help me with this, I would be thankful Frank -- 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/d/optout.
Re: [git-users] How to make sharing directories instead of duplicating?
On Thu, 25 Sep 2014 00:08:24 -0700 (PDT) Віктор Невідомий wrote: > Hello. I have some question about advanced git usage. I ask it > on stackoverflow, but receive only one not very extensive answer. I > post only link to avoid duplicating question here. > http://stackoverflow.com/questions/25991234/git-how-to-make-sharing-directories-instead-of-duplicating/ > Please help me. You can't get a better answer: in Git, directories mean nothing to the VCS, and if you need to share them across different projects, you have to turn each of these directories into separate repositories and either use the so-called "subtree merging" or submodules. Both concepts are explained in any decent book on Git (including [1]). The backgrounds of why Git approaches this task like it does require deep technical discussion with lots of text. I hope you'll gain this understanding all by yourself once you know Git concepts better. P.S. A minor nitpick: good netiquette hints that it still would be better if you have copied the original answer inline: not all subscribers read their mail online, and certainly not all of them use Google's web interface to do so. 1. http://git-scm.com/book -- 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/d/optout.
[git-users] How to make sharing directories instead of duplicating?
Hello. I have some question about advanced git usage. I ask it on stackoverflow, but receive only one not very extensive answer. I post only link to avoid duplicating question here. http://stackoverflow.com/questions/25991234/git-how-to-make-sharing-directories-instead-of-duplicating/ Please help me. -- 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/d/optout.