summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-04-12Don't show gitlink directories when we want "other" filesLibravatar Linus Torvalds1-0/+2
When "show_other_directories" is set, that implies that we are looking for untracked files, which obviously means that we should ignore directories that are marked as gitlinks in the index. This fixes "git status" in a superproject, that would otherwise always report that subprojects were "Untracked files:" Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-12Teach git-update-index about gitlinksLibravatar Linus Torvalds1-62/+138
I finally got around to looking at Alex' patch to teach update-index about gitlinks too, so that "git commit -a" along with any other explicit update-index scripts can work. I don't think there was anything wrong with Alex' patch, but the code he patched I felt was just so ugly that the added cases just pushed it over the edge. Especially as I don't think that patch necessarily did the right thing for a gitlink entry that already existed in the index, but that wasn't actually a real git repository in the working tree (just an empty subdirectory or a non-git snapshot because it hadn't wanted to track that particular subproject). So I ended up deciding to clean up the git-update-index handling the same way I tackled the directory traversal used by git-add earlier: by splitting the different cases up into multiple smaller functions, and just making the code easier to read (and adding more comments about the different cases). So this replaces the old "process_file()" with a new "process_path()" function that then just calls out to different helper functions depending on what kind of path it is. Processing a nondirectory ends up being just one of the simpler cases. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-11Teach directory traversal about subprojectsLibravatar Linus Torvalds3-19/+121
This is the promised cleaned-up version of teaching directory traversal (ie the "read_directory()" logic) about subprojects. That makes "git add" understand to add/update subprojects. It now knows to look at the index file to see if a directory is marked as a subproject, and use that as information as whether it should be recursed into or not. It also generally cleans up the handling of directory entries when traversing the working tree, by splitting up the decision-making process into small functions of their own, and adding a fair number of comments. Finally, it teaches "add_file_to_cache()" that directory names can have slashes at the end, since the directory traversal adds them to make the difference between a file and a directory clear (it always did that, but my previous too-ugly-to-apply subproject patch had a totally different path for subproject directories and avoided the slash for that case). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-11Fix thinko in subproject entry sortingLibravatar Linus Torvalds1-2/+2
This fixes a total thinko in my original series: subprojects do *not* sort like directories, because the index is sorted purely by full pathname, and since a subproject shows up in the index as a normal NUL-terminated string, it never has the issues with sorting with the '/' at the end. So if you have a subproject "proj" and a file "proj.c", the subproject sorts alphabetically before the file in the index (and must thus also sort that way in a tree object, since trees sort as the index). In contrast, it you have two files "proj/file" and "proj.c", the "proj.c" will sort alphabetically before "proj/file" in the index. The index itself, of course, does not actually contain an entry "proj/", but in the *tree* that gets written out, the tree entry "proj" will sort after the file entry "proj.c", which is the only real magic sorting rule. In other words: the magic sorting rule only affects tree entries, and *only* affects tree entries that point to other trees (ie are of the type S_IFDIR). Anyway, that thinko just means that we should remove the special case to make S_ISDIRLNK entries sort like S_ISDIR entries. They don't. They sort like normal files. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-10Teach core object handling functions about gitlinksLibravatar Linus Torvalds4-6/+54
This teaches the really fundamental core SHA1 object handling routines about gitlinks. We can compare trees with gitlinks in them (although we can not actually generate patches for them yet - just raw git diffs), and they show up as commits in "git ls-tree". We also know to compare gitlinks as if they were directories (ie the normal "sort as trees" rules apply). [jc: amended a cut&paste error] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-10Teach "fsck" not to follow subproject linksLibravatar Linus Torvalds2-2/+22
Since the subprojects don't necessarily even exist in the current tree, much less in the current git repository (they are totally independent repositories), we do not want to try to follow the chain from one git repository to another through a gitlink. This involves teaching fsck to ignore references to gitlink objects from a tree and from the current index. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-10Add "S_IFDIRLNK" file mode infrastructure for git linksLibravatar Linus Torvalds1-1/+19
This just adds the basic helper functions to recognize and work with git tree entries that are links to other git repositories ("subprojects"). They still aren't actually connected up to any of the code-paths, but now all the infrastructure is in place. The next commit will start actually adding actual subproject support. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-10Add 'resolve_gitlink_ref()' helper functionLibravatar Linus Torvalds2-0/+83
This new function resolves a ref in *another* git repository. It's named for its intended use: to look up the git link to a subproject. It's not actually wired up to anything yet, but we're getting closer to having fundamental plumbing support for "links" from one git directory to another, which is the basis of subproject support. [jc: amended a FILE* leak] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-09Avoid overflowing name buffer in deep directory structuresLibravatar Linus Torvalds1-0/+3
This just makes sure that when we do a read_directory(), we check that the filename fits in the buffer we allocated (with a bit of slop) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-09diff-lib: use ce_mode_from_stat() rather than messing with modes manuallyLibravatar Linus Torvalds1-12/+3
The diff helpers used to do the magic mode canonicalization and all the other special mode handling by hand ("trust executable bit" and "has symlink support" handling). That's bogus. Use "ce_mode_from_stat()" that does this all for us. This is also going to be required when we add support for links to other git repositories. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-09git-archive: make tar the default formatLibravatar René Scharfe3-5/+12
As noted by Junio, --format=tar should be assumed if no format was specified. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-08Merge branch 'jc/push'Libravatar Junio C Hamano1-7/+10
* jc/push: git-push to multiple locations does not stop at the first failure git-push reports the URL after failing.
2007-04-08Merge branch 'jc/merge-subtree'Libravatar Junio C Hamano7-3/+373
* jc/merge-subtree: A new merge stragety 'subtree'. It is safe to merge this early as this is a feature that user explicitly needs to ask for and would not trigger otherwise. A known issue with the current implementation is that the subtree matching heuristics is very stupid. It could run ls-tree twice and try to count intersection. Giving it wider audience would help it to get improved by motivated volunteers. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-08Merge branch 'js/fetch-progress'Libravatar Junio C Hamano1-4/+10
* js/fetch-progress: git-fetch: add --quiet
2007-04-08Merge branch 'maint'Libravatar Junio C Hamano2-22/+31
* maint: Add Documentation/cmd-list.made to .gitignore git-svn: fix log command to avoid infinite loop on long commit messages git-svn: dcommit/rebase confused by patches with git-svn-id: lines git-svn: bail out on incorrect command-line options
2007-04-08Add Documentation/cmd-list.made to .gitignoreLibravatar Junio C Hamano1-0/+1
Noticed by Randal L. Schwartz. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-08git-svn: fix log command to avoid infinite loop on long commit messagesLibravatar Eric Wong1-2/+9
This bug has been around since the the conversion to use the Git.pm library back in October or November. Eventually I'd like "git rev-list/log" to have the option to not truncate overly long messages. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-08git-svn: dcommit/rebase confused by patches with git-svn-id: linesLibravatar Eric Wong1-20/+21
When patches are merged from another git-svn managed branch, they will have the git-svn-id: metadata line in them (generated by git-format-patch). When doing rebase or dcommit via git-svn, this would cause git-svn to find the wrong upstream branch. We now verify that the commit is consistent with the value in the .rev_db file. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-08git-svn: bail out on incorrect command-line optionsLibravatar Eric Wong1-1/+4
"git svn log" is the only command that needs the pass-through option in Getopt::Long; otherwise we will bail out and let the user know something is wrong. Also, avoid printing out unaccepted mixed-case options (that are reserved for the command-line) such as --useSvmProps in the usage() function. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07Start 1.5.2 cycle by prepareing RelNotes for it.Libravatar Junio C Hamano2-1/+77
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07Merge branch 'jc/read-tree-df' (early part)Libravatar Junio C Hamano4-28/+167
* 'jc/read-tree-df' (early part): Fix switching to a branch with D/F when current branch has file D. Fix twoway_merge that passed d/f conflict marker to merged_entry(). Fix read-tree --prefix=dir/. unpack-trees: get rid of *indpos parameter. unpack_trees.c: pass unpack_trees_options structure to keep_entry() as well. add_cache_entry(): removal of file foo does not conflict with foo/bar
2007-04-07Merge branch 'maint'Libravatar Junio C Hamano2-4/+50
* maint: Prepare for 1.5.1.1 cvsserver: small corrections to asciidoc documentation
2007-04-07Prepare for 1.5.1.1Libravatar Junio C Hamano2-1/+47
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07cvsserver: small corrections to asciidoc documentationLibravatar Frank Lichtenheld1-4/+4
Fix a typo: s/Not/Note/ Some formating fixes: Use ` ` syntax for all filenames and ' ' syntax for all commandline switches. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07A new merge stragety 'subtree'.Libravatar Junio C Hamano7-3/+373
This merge strategy largely piggy-backs on git-merge-recursive. When merging trees A and B, if B corresponds to a subtree of A, B is first adjusted to match the tree structure of A, instead of reading the trees at the same level. This adjustment is also done to the common ancestor tree. If you are pulling updates from git-gui repository into git.git repository, the root level of the former corresponds to git-gui/ subdirectory of the latter. The tree object of git-gui's toplevel is wrapped in a fake tree object, whose sole entry has name 'git-gui' and records object name of the true tree, before being used by the 3-way merge code. If you are merging the other way, only the git-gui/ subtree of git.git is extracted and merged into git-gui's toplevel. The detection of corresponding subtree is done by comparing the pathnames and types in the toplevel of the tree. Heuristics galore! That's the git way ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07git-push to multiple locations does not stop at the first failureLibravatar Junio C Hamano1-7/+8
When pushing into multiple repositories with git push, via multiple URL in .git/remotes/$shorthand or multiple url variables in [remote "$shorthand"] section, we used to stop upon the first failure. Continue the operation and report the failure at the end. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07git-push reports the URL after failing.Libravatar Junio C Hamano1-0/+2
This came up on #git when somebody was getting 'unable to create ./objects/tmp_oXXXX' but sweared he had write permission to that directory. It turned out that the repository URL was changed and he was accessing a repository he does not have a write permission anymore. I am not sure how much this would have helped somebody who believed he was accessing location when the permission of that location was changed while he was looking the other way, though. But giving more information on the error path would be better, and the next change would be helped with this as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-07Merge branch 'jc/index-output'Libravatar Junio C Hamano13-25/+66
* jc/index-output: git-read-tree --index-output=<file> _GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index file. Conflicts: builtin-apply.c
2007-04-07Merge branch 'fp/make-j'Libravatar Junio C Hamano1-2/+2
* fp/make-j: Makefile: Add '+' to QUIET_SUBDIR0 to fix parallel make.
2007-04-07Merge branch 'cc/bisect'Libravatar Junio C Hamano3-66/+199
* cc/bisect: git-bisect: allow bisecting with only one bad commit. t6030: add a bit more tests to git-bisect git-bisect: modernization Documentation: bisect: "start" accepts one bad and many good commits Bisect: teach "bisect start" to optionally use one bad and many good revs.
2007-04-07Merge branch 'jc/checkout' (early part)Libravatar Junio C Hamano2-3/+64
* 'jc/checkout' (early part): checkout: allow detaching to HEAD even when switching to the tip of a branch
2007-04-07Merge branch 'maint'Libravatar Junio C Hamano11-67/+87
* maint: Documentation: tighten dependency for git.{html,txt} Makefile: iconv() on Darwin has the old interface t5300-pack-object.sh: portability issue using /usr/bin/stat t3200-branch.sh: small language nit usermanual.txt: some capitalization nits Make builtin-branch.c handle the git config file rename_ref(): only print a warning when config-file update fails Distinguish branches by more than case in tests. Avoid composing too long "References" header. cvsimport: Improve formating consistency cvsimport: Reorder options in documentation for better understanding cvsimport: Improve usage error reporting cvsimport: Improve documentation of CVSROOT and CVS module determination cvsimport: sync usage lines with existing options Conflicts: Documentation/Makefile
2007-04-06Documentation: tighten dependency for git.{html,txt}Libravatar Junio C Hamano2-4/+17
Every time _any_ documentation page changed, cmds-*.txt files were regenerated, which caused git.{html,txt} to be remade. Try not to update cmds-*.txt files if their new contents match the old ones. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06Makefile: iconv() on Darwin has the old interfaceLibravatar Arjen Laarhoven1-0/+1
The libiconv on Darwin uses the old iconv() interface (2nd argument is a const char **, instead of a char **). Add OLD_ICONV to the Darwin variable definitions to handle this. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Acked-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06t5300-pack-object.sh: portability issue using /usr/bin/statLibravatar Arjen Laarhoven1-5/+6
In the test 'compare delta flavors', /usr/bin/stat is used to get file size. This isn't portable. There already is a dependency on Perl, use its '-s' operator to get the file size. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06git-bisect: allow bisecting with only one bad commit.Libravatar Junio C Hamano2-45/+59
This allows you to say: git bisect start git bisect bad $bad git bisect next to start bisection without knowing a good commit. This would have you try a commit that is half-way since the beginning of the history, which is rather wasteful if you already know a good commit, but if you don't (or your history is short enough that you do not care), there is no reason not to allow this. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06t6030: add a bit more tests to git-bisectLibravatar Junio C Hamano1-1/+37
Verify that git-bisect does not start before getting one bad and one good commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06t3200-branch.sh: small language nitLibravatar Arjen Laarhoven1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06usermanual.txt: some capitalization nitsLibravatar Arjen Laarhoven1-4/+4
Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06Make builtin-branch.c handle the git config fileLibravatar Lars Hjemli2-10/+6
This moves the knowledge about .git/config usage out of refs.c and into builtin-branch.c instead, which allows git-branch to update HEAD to point at the moved branch before attempting to update the config file. It also allows git-branch to exit with an error code if updating the config file should fail. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06rename_ref(): only print a warning when config-file update failsLibravatar Lars Hjemli1-1/+1
If git_config_rename_section() fails, rename_ref() used to return 1, which left HEAD pointing to an absent refs/heads file (since the actual renaming had already occurred). Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06Distinguish branches by more than case in tests.Libravatar Brian Gernhardt1-3/+3
The renaming without config test changed a branch from q to Q, which fails on non-case sensitive file systems. Change the test to use q and q2. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06Avoid composing too long "References" header.Libravatar YOSHIFUJI Hideaki / 吉藤英明1-1/+1
The number of characters in a line MUST be no more than 998 characters, and SHOULD be no more than 78 characters (RFC2822). It is much safer to fold the header by ourselves. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06cvsimport: Improve formating consistencyLibravatar Frank Lichtenheld1-3/+3
Use ' ' syntax for all commandline options mentioned in text. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06cvsimport: Reorder options in documentation for better understandingLibravatar Frank Lichtenheld1-27/+27
The current order the options are documented in makes no sense at all to me. Reorder them so that similar options are grouped together and also order them somehwhat by importance. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06cvsimport: Improve usage error reportingLibravatar Frank Lichtenheld1-4/+6
Actually tell the user what he did wrong in case of usage errors instead of only printing the general usage information. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06cvsimport: Improve documentation of CVSROOT and CVS module determinationLibravatar Frank Lichtenheld1-2/+6
Document the fact that git-cvsimport tries to find out CVSROOT from CVS/Root and $ENV{CVSROOT} and CVS_module from CVS/Repository. Also use ` ` syntax for all filenames for consistency. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-06cvsimport: sync usage lines with existing optionsLibravatar Frank Lichtenheld2-5/+8
Sync both the usage lines in the code and the asciidoc documentation with the real list of options. While all options seems to be documented in the asciidoc document, not all of them were listed in the usage line. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-05git-bisect: modernizationLibravatar Junio C Hamano1-5/+4
This slightly modernizes the bisect script to use show-ref/for-each-ref instead of looking into $GIT_DIR/refs files directly. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-05Merge branch 'maint'Libravatar Junio C Hamano17-19/+98
* maint: Fix lseek(2) calls with args 2 and 3 swapped Honor -p<n> when applying git diffs Fix dependency of common-cmds.h Fix renaming branch without config file DESTDIR support for git/contrib/emacs gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patches Document --left-right option to rev-list. Revert "builtin-archive: use RUN_SETUP" rename contrib/hooks/post-receieve-email to contrib/hooks/post-receive-email. rerere: make sorting really stable. Fix t4200-rerere for white-space from "wc -l"