Re: [git-users] moving files to names that were part of the repository
Michael schreef op 12-08-2016 23:01: On 2016-08-12, at 10:54 AM, Konstantin Khomoutov wrote: git config --add --global alias.rlog `log -M -C` Ok, can you tell me what I'm doing wrong here? You're using the wrong quotes. The backticks are going to try to execute a command and replace its output there on the command line in this case. So it tries to execute the command "log" (not git log or anything) and it fails because log does not exist. Regards. (You need to use regular apostroph). -- 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] moving files to names that were part of the repository
On 2016-08-12, at 10:54 AM, Konstantin Khomoutov wrote: > 1. http://www.gelato.unsw.edu.au/archives/git/0504/0598.html Wow, that thread got big really fast... --- Entertaining minecraft videos http://YouTube.com/keybounce -- 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] moving files to names that were part of the repository
On 2016-08-12, at 10:54 AM, Konstantin Khomoutov wrote: > git config --add --global alias.rlog `log -M -C` Ok, can you tell me what I'm doing wrong here? keybounceMBP:Finite-Fluids michael$ git config --add --global alias.rlog `log -M -C` -bash: log: command not found error: wrong number of arguments usage: git config [] Config file location --global use global config file --system use system config file --local use repository config file -f, --file use given config file --blob read config from given blob object ... --- Entertaining minecraft videos http://YouTube.com/keybounce -- 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] moving files to names that were part of the repository
Konstantin Khomoutov schreef op 12-08-2016 19:54: Depend on what you're asking for. If you have asked about the `git log`, then yes: have an alias like git config --add --global alias.rlog `log -M -C` If you have asked about whether it's possible to change the way Git stores the history, then the answer is no. As usually, I'd urge you to read an extensive overview of why Git manages information in the way it does provided by its very creator [1]. While you certainly may disagree on the points made there and/or with the conclusions drawn, it helps in acquiring the correct perspective: in that text, some interesting areas are covered -- such as obtaining the same information from several sources in an (octopus) merge or patches -- things most of us never deal with. What I'm leading to, is that Git was created not as an academic project to create some idealized VC system tailored for no particular real-world case, and implementing whatever seemed "sensible" for a VC system to do. Well, I don't care too much about other people's opinions or what they think should be the proper use case for a certain system, after all, my particular question was not at all of the academic kind, but pertained to a particular use case of being able to easily perceive the history of a file, in the sense of knowing where it came from and what has happened to it. I know (now) there are Git tools that will show me this information, likely. I am not concerned with changing the internals of Git. If, as you say, Git is perfectly capable of piecing together the "real" history of a file without actually storing that information (directly), then from a practical point of view it shouldn't matter all that much, as long as it is usable and accessible. I am sure the philosophical underpinnings of Git are quite proficient, including its fundamental "efficiency" model so to speak. But I don't need to know abut them today (maybe later). First comes a use case and automated tools are fine but many of the higher level Git commands are not easy to use and take a while to put them into your system where you have all these aliases; and any system with a lot of aliases that are actually quite required in order for the system to be useful really increase the scope of the commitment you must have to the system in the first place. The short way of saying that is that defaults matter, of course. So today for me this question was really about: what do real people, regular people, do, when they are discontent with the level of information that is usually shown, and what would be their best practices in showing that. I will attempt Git -M -C next time I use it, thank you. The problem I have constantly is that I am "very bad at" saving all of these customizations so I have to reapply them each time I install a new system, so to speak, quite literally. This just puts a bigger burden onto the usability of the system because those "customizations" are pretty much required for a proper use of the system, I feel, and this "developmental investment" is something you need to save. I haven't been able to do so very well thus far, usually. They weren't important enough but still bite you when you don't have them :-/. 1. http://www.gelato.unsw.edu.au/archives/git/0504/0598.html Thank you for the long text you wrote anway, relatively speaking, very few people take the time to write anything as thorough or complete like that, or anything of that kind. So again, I do appreciate you taking the time to write that. It's just that git is a bit of a git at times ;-). (As per the words of Mister Torvalds himself, I guess). Regards :). -- 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] moving files to names that were part of the repository
On Fri, 12 Aug 2016 18:59:37 +0200 Xen wrote: > > What `git mv` did is removed -- from the commit you have recorded > > after running that command -- the file as it was known under its > > old name and added the same contents under its new name. > > Sometimes Git will recognise something as a rename if you do nothing > else in that commit, but if you merge the commit with something else, > suddenly it will not see or show it as that anymore. > > For me personally too, renames are meaningful. > > It's shame these renames are not detected or shown my by default. > > Is there a best level approach to being more aware of any renames you > have done? > > For a person seeing a delete and an add of the same file under the > different names is rather difficult to follow. > > Is there an option to get Git to always track renames? Depend on what you're asking for. If you have asked about the `git log`, then yes: have an alias like git config --add --global alias.rlog `log -M -C` If you have asked about whether it's possible to change the way Git stores the history, then the answer is no. As usually, I'd urge you to read an extensive overview of why Git manages information in the way it does provided by its very creator [1]. While you certainly may disagree on the points made there and/or with the conclusions drawn, it helps in acquiring the correct perspective: in that text, some interesting areas are covered -- such as obtaining the same information from several sources in an (octopus) merge or patches -- things most of us never deal with. What I'm leading to, is that Git was created not as an academic project to create some idealized VC system tailored for no particular real-world case, and implementing whatever seemed "sensible" for a VC system to do. Quite on the contrary, Git is a very opininonated SCM tailored for the single particular case: managing the Linux kernel. The properties it gained thanks to that goal (notably the blazing speed in the common case of lots of small- to mid-sized files, and a set of sharp and powerful tools) supposedly made it the most used SCM today, but it's still an opinionated system, and it helps to know these "opinions" to understand why it does things the way it does. So take this text not as a dogma to follow and praise but as an in-depth explanation of the design. 1. http://www.gelato.unsw.edu.au/archives/git/0504/0598.html -- 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] moving files to names that were part of the repository
Konstantin Khomoutov schreef op 12-08-2016 18:29: What `git mv` did is removed -- from the commit you have recorded after running that command -- the file as it was known under its old name and added the same contents under its new name. Sometimes Git will recognise something as a rename if you do nothing else in that commit, but if you merge the commit with something else, suddenly it will not see or show it as that anymore. For me personally too, renames are meaningful. It's shame these renames are not detected or shown my by default. Is there a best level approach to being more aware of any renames you have done? For a person seeing a delete and an add of the same file under the different names is rather difficult to follow. Is there an option to get Git to always track renames? -- 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] moving files to names that were part of the repository
On Fri, 12 Aug 2016 17:42:20 +0200 Pablo Rodríguez wrote: > I’m writing a book with git as control version system. > > I have been writing over 300 pages in a file named `my-book.tex`. Now > I realize that I should start it from scratch. So I just `git mv > my-book.tex old-draft.tex`. > > The new book will have also a `my-book.tex` file. The file has been > added to git (at I commited some changes) with the name > `new-book.tex`. > > Would it be problematic in the future if I `git mv new-book.tex > my-book.tex`? > > I assume that git history will include the name change and it won’t > change file contents. Is that right or am I missing something? No, the history won't specifically include any information about the name change (Git does not explicitly track renames of the entities it manages) but nothing bad will happen notwithstanding. What `git mv` did is removed -- from the commit you have recorded after running that command -- the file as it was known under its old name and added the same contents under its new name. So, all the old history is still there (in the commits before the rename) and all the new history is there as well. The only problem this might cause is that if you will run an unadorned git log old-draft.tex command, it will stop traversing the chain of commits touching "old-draft.tex" as soon as it hits the commit in which that file was renamed. If you want to make `git log` still dig deeper down the history, you need to explicitly tell it to detect renames. Please read the `git log` manual for the --find-renames (and --find-copies) command-line options. In other words, Git tracks contents paying little attention to where exactly it is located in terms of files; and if you get concerned about locations, Git is able to detect renames and copies at the time it traverses the recorded history of your repository. I understand that many people have difficulty grasping this approach but note that quite many "questions" you may ask your history are really not concerned with files. Say, you can ask Git to look for the commit in which a particular word or sentence was added or removed, and it will search through the contents, not files. That is, Git assumes a project is a whole thing. If you are tempted to consider histories of individual files in the project this might be indicative of the fact you might better have different projects for these different files. -- 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] moving files to names that were part of the repository
On 2016-08-12, at 8:42 AM, Pablo Rodríguez wrote: > Dear list, > > I’m writing a book with git as control version system. > > I have been writing over 300 pages in a file named `my-book.tex`. Now I > realize that I should start it from scratch. So I just `git mv > my-book.tex old-draft.tex`. > > The new book will have also a `my-book.tex` file. The file has been > added to git (at I commited some changes) with the name `new-book.tex`. > > Would it be problematic in the future if I `git mv new-book.tex > my-book.tex`? > > I assume that git history will include the name change and it won’t > change file contents. Is that right or am I missing something? > > Many thanks for your help, > > Pablo > -- > http://www.ousia.tk It sounds like you have a concern about git tracking changes in a file based on the name of the file. Git actually matches files based on their content more than their name or the blob that they came in. While I have not seen this myself, others have told me that git can even tell if a file is split into two parts, and track which lines came from which file. So having a file move to "old", and something else come in with the same name but different content will not be a problem -- git tracks the content changes more than the file name. --- Entertaining minecraft videos http://YouTube.com/keybounce -- 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] moving files to names that were part of the repository
Dear list, I’m writing a book with git as control version system. I have been writing over 300 pages in a file named `my-book.tex`. Now I realize that I should start it from scratch. So I just `git mv my-book.tex old-draft.tex`. The new book will have also a `my-book.tex` file. The file has been added to git (at I commited some changes) with the name `new-book.tex`. Would it be problematic in the future if I `git mv new-book.tex my-book.tex`? I assume that git history will include the name change and it won’t change file contents. Is that right or am I missing something? Many thanks for your help, Pablo -- http://www.ousia.tk -- 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.