Re: [git-users] Re: listing of ignored files is incomplete?
On Mon, 25 Mar 2013 16:31:54 +0100 Jeroen De Vlieger wrote: > I guess, it depends on what you call empty. And even then it is kind > of confusing with the statement that git tracks files, *not* > directories. > > Hence I would expect git to also ignores files not the directory > itself. Hence in my opinion it should list all ignored files in your > working directory which are not tracked. I feel that it does not > matter whether the directory, is empty or not. Especially since git > doesn't really track directories, it tracks files. For that matter: > Why does git even have concept of a directory, empty or otherwise? If > it only tracks files? To be precise, Git developers like to say Git does not even track files, but it rather tracks *content* instead. This is true in some way: for instance Git does not explicitly tracks renames of files and directories, and to detect them, its various history-walking tools employ special heuristics. On the other hand, one cannot ignore files completely, as most contemporary computer systems on which Git is used use files as the means of managing persistent storage of information. So Git uses the concept of file names to some extent: its tools working with local file system manipulate files (obviously), and the so-called "trees" in the Git database keep names of the original files used to place their contents to the Git database. Asking on the main Git list might be a good idea anyway. At least you might receive an explanation of the background for such design decision. -- 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] Re: listing of ignored files is incomplete?
I guess, it depends on what you call empty. And even then it is kind of confusing with the statement that git tracks files, *not* directories. Hence I would expect git to also ignores files not the directory itself. Hence in my opinion it should list all ignored files in your working directory which are not tracked. I feel that it does not matter whether the directory, is empty or not. Especially since git doesn't really track directories, it tracks files. For that matter: Why does git even have concept of a directory, empty or otherwise? If it only tracks files? hmm maybe I should post this to the git list as Konstantin mentioned. Jeroen On Mon, Mar 25, 2013 at 2:34 PM, Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Mon, 25 Mar 2013 14:10:13 +0100 > Jeroen De Vlieger wrote: > > > Any idea on this design choice? when I ask to list ignored files, and > > some are not listed, then it feels like bug. Or in this case a bad > > design decision. > > As Thomas said, Git does not track directories. For instance, you > can't `git add` an empty directory, and `git add ` does only > seem to make Git track that directory because it makes Git track *files* > under that directory. > > I have no idea about why Git devs picked this design choice and not > some other; I also perceive this behaviour might be confusing. > > Another thing to consider is that this list is dedicated to helping > novice users. If you feel like you've found a bug or misfeature, > please feel free to bring it up on the main Git list [1] as Git devs > do not read the list which we're currently using for conversing. > > 1. https://gist.github.com/tfnico/4441562 > -- 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] Re: listing of ignored files is incomplete?
On Mon, 25 Mar 2013 14:10:13 +0100 Jeroen De Vlieger wrote: > Any idea on this design choice? when I ask to list ignored files, and > some are not listed, then it feels like bug. Or in this case a bad > design decision. As Thomas said, Git does not track directories. For instance, you can't `git add` an empty directory, and `git add ` does only seem to make Git track that directory because it makes Git track *files* under that directory. I have no idea about why Git devs picked this design choice and not some other; I also perceive this behaviour might be confusing. Another thing to consider is that this list is dedicated to helping novice users. If you feel like you've found a bug or misfeature, please feel free to bring it up on the main Git list [1] as Git devs do not read the list which we're currently using for conversing. 1. https://gist.github.com/tfnico/4441562 -- 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] Re: listing of ignored files is incomplete?
Any idea on this design choice? when I ask to list ignored files, and some are not listed, then it feels like bug. Or in this case a bad design decision. Jeroen On Mon, Mar 25, 2013 at 2:02 PM, Thomas Ferris Nicolaisen wrote: > On Monday, March 25, 2013 11:43:21 AM UTC+1, Jeroen De Vlieger wrote: > >> lets create a new git repo >> >> $ mkdir testRepo >> $ cd testRepo >> $ mkdir dirWithOnlyIgnoredFiles >> $ touch dirWithOnlyIgnoredFiles/foo.**log >> $ touch test.txt >> $ touch main.log >> $ git init >> >> now lets ignore the log files >> >> $ echo '*.log' > .gitignore >> >> stage all non-ignored files and creat a commit >> >> $ git add . >> $ git commit -m 'foo' >> >> now lets list the ignore files >> >> $ git status --ignored >> # On branch master >> # Ignored files: >> # (use "git add -f ..." to include in what will be committed) >> # >> # main.log >> nothing to commit (working directory clean) >> >> Note the the log file in the 'dirWithOnlyIgnoredFiles' is *not* listed, >> although I would presume that it is indeed an ignored file. >> What happened here? >> >> > Git ignores empty directories (by design). A directory with only ignored > files is also counted as being empty. Hence, when you add a non-ignored > file inside the directory, the directory gets noticed. > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Git for human beings" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/git-users/VS-1YqpIfPk/unsubscribe?hl=en-US > . > To unsubscribe from this group and all its topics, 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.