aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add compat/setenv.c, use in git.c.Jason Riedy2005-12-03
| | | | | | | | | | | | | | There is no setenv() in Solaris 5.8. The trivial calls to setenv() were replaced by putenv() in a much earlier patch, but setenv() was used again in git.c. This patch just adds a compat/setenv.c. The rule for building git$(X) also needs to include compat. objects and compiler flags. Those are now in makefile vars COMPAT_OBJS and COMPAT_CFLAGS. Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* New test case: Criss-cross mergeFredrik Kuivinen2005-12-03
| | | | | Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* New test case: merge with directory/file conflictsFredrik Kuivinen2005-12-03
| | | | | Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* test-lib.sh: Add new function, test_expect_codeFredrik Kuivinen2005-12-03
| | | | | | | The test is considered OK if it exits with code $1 Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-merge: Exit with code 2 if no strategy was able to handle the merge.Fredrik Kuivinen2005-12-03
| | | | | | | | This way it is possible to test in scripts if the merge was non-clean or if the strategy had other problems with the merge. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
* documentation: git-tagNo name2005-12-02
| | | | | | [jc: light edit applied on top of the original] Signed-off-by: Junio C Hamano <junkio@cox.net>
* documentation: git-bisect (help HTML break man)Junio C Hamano2005-12-02
| | | | | | | | | | Use the same trick Josef used to introduce line breaks for git-mv documentation for now, to help HTML rendering. This breaks manpages and we need to come up with a better solution. Noticed by linux@horizon.com (No Name). Signed-off-by: Junio C Hamano <junkio@cox.net>
* documentation: clarify read-tree --resetNo name2005-12-02
| | | | | | [jc: light edit applied on top of the original] Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-merge documentation: conflicting merge leaves higher stages in indexJunio C Hamano2005-12-02
| | | | | | | | | | This hopefully concludes the latest updates that changes the behaviour of the merge on an unsuccessful automerge. Instead of collapsing the conflicted path in the index to show HEAD, we leave it unmerged, now that diff-files can compare working tree files with higher stages. Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-one-file: make sure we do not mismerge symbolic links.Junio C Hamano2005-12-02
| | | | | | | We ran "merge" command on O->A, O->B, A!=B case without verifying the path involved is not a symlink. Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-one-file: make sure we create the merged file.Junio C Hamano2005-12-02
| | | | | | | | | | | The "update-index followed by checkout-index" chain served two purposes -- to collapse the index to "our" version, and make sure that file exists in the working tree. In the recent update to leave the index unmerged on conflicting path, we wanted to stop doing the former, but we still need to do the latter (we allow merging to work in an un-checked-out working tree). Signed-off-by: Junio C Hamano <junkio@cox.net>
* t3100: add ls-tree -t and -d tests.Junio C Hamano2005-12-01
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* merge-recursive: adjust git-ls-tree use for the latest.Junio C Hamano2005-12-01
| | | | | | | | | You need to pass -t flag if you want to see tree objects in "git-ls-tree -r" output these days. This change broke the tree structure reading code in git-merge-recursive used to detect D/F conflicts. Signed-off-by: Junio C Hamano <junkio@cox.net>
* git wrapper: more careful argument stuffingAlex Riesen2005-12-01
| | | | | | | | | | | | - Use stderr for error output - Build git_command more careful - ENOENT is good enough for check of failed exec to show usage, no access() check needed [jc: Originally from Alex Riesen with inputs from Sven Verdoolaege mixed in.] Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-merge-one-file: do not worry about 'rmdir -p' not removing directory.Junio C Hamano2005-12-01
| | | | | | | | 9ae2172aed289f2706a0e88288909fa47eddd7e7 used "rmdir -p" carelessly, causing the more important "git-update-index --remove" to be skipped. Signed-off-by: Junio C Hamano <junkio@cox.net>
* ls-tree: --name-onlyJunio C Hamano2005-12-01
| | | | | | | | | | | | | | Fingers of some "git diff" users are trained to do --name-only which git-ls-tree unfortunately does not take. With this, cd sub/directory && git-ls-tree -r --name-only .. would show only the names not object names nor modes. I threw in another synonym --name-status only for usability, but obviously ls-tree does not do any comparison so what it does is the same as --name-only. Signed-off-by: Junio C Hamano <junkio@cox.net>
* ls-tree: resurrect '-d' to mean 'show trees only'Junio C Hamano2005-12-01
| | | | | | | | | | | | | | | | | | | | With this: git-ls-tree -d HEAD -- drivers/net/ shows only immediate subtrees of drivers/net. git-ls-tree -d -t HEAD -- drivers/net/ shows drivers, drivers/net and immediate subtrees of drivers/net. git-ls-tree -d -r HEAD -- drivers/net/ shows drivers, drivers/net and all subtrees of drivers/net (but not blobs). Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-ls-tree: add "-t" option to always show the tree entriesLinus Torvalds2005-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old (new) behaviour was that it only shows trees if the object is specified exactly, and recursive is not set. That makes sense, because there is obviously nothing else it can show for that case. However, with the new "-t" option, it will show the tree even with "-r", as it traverses down into it. NOTE! This also means that it will show all trees leading up to that tree. For example, if you do a git-ls-tree -t HEAD -- drivers/char/this/file/does/not/exist it will show the trees that lead up to the files that do not exist: [torvalds@g5 linux]$ git-ls-tree -t HEAD -- drivers/char/this/file/does/not/exist 040000 tree 9cb687b77dcd64bf82e9a73214db467c964c1266 drivers 040000 tree 298e2fadf0ff3867d1ef49936fd2c7bf6ce1eb66 drivers/char [torvalds@g5 linux]$ and note how this is true even though I didn't specify "-r": the fact that I supplied a pathspec automatically implies "enough recursion" for that particular pathspec. I think the code is cleaner and easier to understand too: the patch looks bigger, but it's really just splitting up the "should we recurse into this tree" into a function of its own. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Makefile: say the default target upfront.Junio C Hamano2005-12-01
| | | | | | | | Alex Riesen wants to keep extra makefile targets in config.mak, but the file is included before any of our real targets. Having this at the beginning allows you to do so. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Documentation: describe '-f' option to git-fetch.Junio C Hamano2005-12-01
| | | | | | | | | The option description header was there without body text, confusingly getting rendered as if the description for --tags applied to the option. Noticed by Carl Baldwin. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Move couple of ifdefs after "include config.mk"Timo Hirvonen2005-11-30
| | | | | | | | This makes it possible to define WITH_SEND_EMAIL etc. in config.mak. Also remove GIT_LIST_TWEAK because it isn't used anymore. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/subdir'Junio C Hamano2005-11-30
|\
| * hash-object.c: type-fix to squelch compiler warnings.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * define die() for scripts that use it.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | As a fallout from not using git-sh-setup in scripts that can operate from a subdirectory, we lost definition of die() from them. It might make sense to do some cleanup to consolidate them back again, but this should suffice for now. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * verify-tag: make it operable from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * tag: make it operable from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * lost-found: make it operable from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * branch: make it operable from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * ls-remote: define die() now we do not use git-sh-setupJunio C Hamano2005-11-28
| | | | | | | | | | | | | | | | Another interesting "property" is that from inside a git managed tree, "git-ls-remote ." names the current repository no matter how deep a subdirectory you are in. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * count-objects: make it operable from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Make the rest of commands work from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | These commands are converted to run from a subdirectory. commit-tree convert-objects merge-base merge-index mktag pack-objects pack-redundant prune-packed read-tree tar-tree unpack-file unpack-objects update-server-info write-tree Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Make networking commands to work from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | These are whole-tree operations and there is not much point making them operable from within a subdirectory, but it is easy to do so, and using setup_git_directory() upfront helps git:// proxy specification picked up from the correct place. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * ls-tree: work from subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | This makes ls-tree to work from subdirectory. It defaults to show the paths under the current subdirectory, and interprets user-supplied paths as relative to the current subdirectory. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * hash-object: work within subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | When -w is given, it needs to find out where the .git directory is, so run the setup_git_directory() when we see a -w. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * checkout-index: work from subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | With this, git-checkout-index from a subdirectory works as expected. Note that "git-checkout-index -a" checks out files only in the current directory and under. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * fsck-objects: work from subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | Not much point making it work from subdirectory, but for a consistency make it so. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * peek-remote: honor proxy config even from subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | Use setup_git_directory_gently() at the beginning of peek-remote so that git:// proxy can be picked up from the configuration file. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-apply: work from subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | When applying a patch to index file, we need to know where GIT_DIR is; use setup_git_directory() to find it out. This also allows us to work from a subdirectory if we wanted to. When git-apply is run from a subdirectory, it applies the given patch only to the files under the current directory and below. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * working from subdirectory: preparationJunio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | - prefix_filename() is like prefix_path() but can be used to name any file on the filesystem, not the files that might go into the index file. - setup_git_directory_gently() tries to find the GIT_DIR, but does not die() if called outside a git repository. Signed-off-by: Junio C Hamano <junkio@cox.net>
| |
| \
| \
| \
| \
| \
*-----. \ Merge branches 'jc/apply', 'lt/ls-tree', 'lt/bisect' and 'lt/merge'Junio C Hamano2005-11-30
|\ \ \ \ \
| | | | * | Tutorial: adjust merge example to recursive strategy.Junio C Hamano2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current default, merge-recursive, gives slightly different message while working from merge-resolve which was used to prepare the illustration in the tutorial. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | | * | merge-recursive: match the unmerged index entry behaviour with merge-resolveJunio C Hamano2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This minimally changes merge-recursive to match what happens when O->A, O->B, A!=B 3-way filelevel merge leaves conflicts to the new merge-resolve behaviour. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | | * | diff-files: show diffs with stage0 and unmerged stage at the same time.Junio C Hamano2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After thinking about it more, I realized that much of the change I did on top of Linus' version does not make much sense. This commit reverts it so that it by default shows diffs with stage0 paths or stage2 paths with working tree; the unmerged stage to use can be overridden with -1/-2/-3 option (-2 is the default so essentially is a no-op). When the index file is unmerged, we are by definition in the middle of a conflicting merge, and we should show the diff with stage 2 by default. More importantly, paths without conflicts are updated in the working tree and collapsed to stage0 in the index, so showing diff with stage0 at the same time does not hurt. In normal cases, stage0 entries should be in sync with the working tree files and does not clutter the output. It even helps the user to realize that the working tree has local changes unrelated to the merge and remember to be careful not to do a "git-commit -a" after resolving the conflicts. When there is no unmerged entries, giving diff_unmerged_stage a default value of 2 does not cause any harm, because it would not be used anyway. So in all, always showing diff between stage0 paths and unmerged entries from a stage (defaulting to 2) is the right thing to do, as Linus originally did. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | | * | merge-one-file: leave unmerged index entries upon automerge failure.Linus Torvalds2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When automerge fails, we used to collapse the path to stage0 from "our" branch, to help "diff-files" users to view the half-merged state against the current HEAD. Now diff-files has been taught how to compare with unmerged stage2,leaving them unmerged is a better thing to do, especially this prevents the unresolved conflicts to be committed by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | | * | diff-files: -1/-2/-3 to diff against unmerged stage.Linus Torvalds2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While resolving conflicted merge, it was not easy to compare the working tree file with unmerged index entries. This commit introduces new options -1/-2/-3 (with synonyms --base, --ours, and --theirs) to compare working tree files with specified stages. When none of these options are given, the command defaults to -2 if the index file is unmerged, otherwise it acts as before. [jc: majorly butchered from the version Linus originally posted.] Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | * | | bisect: quote pathnames for eval safety.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and make sure they are on the same line. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | * | | bisect: limit the searchspace by pathspecsLinus Torvalds2005-11-28
| | | | |/ | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was surprisingly easy to do. git bisect start <pathspec> followed by all the normal "git bisect good/bad" stuff. Almost totally untested, and I guarantee that if your pathnames have spaces in them (or your GIT_DIR has spaces in it) this won't work. I don't know how to fix that, my shell programming isn't good enough. This involves small changes to make "git-rev-list --bisect" work in the presense of a pathspec limiter, and then truly trivial (and that's the broken part) changes to make "git bisect" save away and use the pathspec. I tried one bisection, and a "git bisect visualize", and it all looked correct. But hey, don't be surprised if it has problems. Linus Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | | ls-tree: match the test to the new semantics.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The diff for this commit is a good illustration of what changed in ls-tree behaviour. - With -r, tree nodes themselves are not shown anymore, but blobs in subtrees are shown. - The order of paths parameters do not matter, since they are not like arguments to /bin/ls, but are filter patterns. - When filter patterns overlap, unintuitive things happen. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | | ls-tree: Resurrect funny name quoting lost during rewrite.Junio C Hamano2005-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rewrite to match ls-files/diff-tree behaviour accidentally lost the name quoting. I am not proud about this code, but this would get the test going. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * | | ls-tree: further tweaks of the rewriteLinus Torvalds2005-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It modifies the selection a bit, so that a pathspec that is a superset of a particular tree path will always cause it to recurse into that tree. As an example, let's say that we do git-ls-tree HEAD drivers/char _without_ the "-r". What will happen is that it will start out doing all the base tree, and for "drivers" it will notice that it's a proper subset of "drivers/char", so it will always recurse into _that_ tree (but not into other trees). Then, it will not match anything else than "char" in that subdirectory, and because that's not a proper superset (it's an exact match), it will _not_ recurse into it, so you get: [torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char 040000 tree 9568cda453aae205bb58983747fa73b9696d9d51 drivers/char which is what you got with the old git-ls-tree too. But interestingly, if you add the slash, it will become a proper superset and it will recurse into _that_ subdirectory (but no deeper: so if you want all subdirectories _below_ drivers/char/, you still need to give "-r"): [torvalds@g5 linux]$ ~/git/git-ls-tree HEAD drivers/char/ 100644 blob 2b6b1d772ed776fff87927fc34adc2e40500218e drivers/char/.gitignore 100644 blob 56b8a2e76ab10a5c21787cb7068a846075cbaffd drivers/char/ChangeLog 100644 blob 970f70d498f4c814e1cf3362e33d7e23ac53c299 drivers/char/Kconfig ... See? This is on top of the previous two diffs, holler if you want a whole new "everything combined" version.. It hasn't gotten lots of testing, but it should work. Linus