aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* 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
| | * | | ls-tree: further cleanup to parallel ls-files.Linus Torvalds2005-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get more a "git-ls-files" approach, this trivial patch (on top of my previous one) enables recursion, and doesn't show partial trees. [jc: after further discussion, this version enables recursion by default, and you can disable it with "-d" flag. git-ls-tree -d HEAD Documentation/no/such/directory shows Documentation tree (without -d it shows nothing). git-ls-tree HEAD shows everything from the tree. Only to get the single level from the top git-ls-tree -d HEAD is needed. But there is no way to get the single level with pathspec. You need to extract the object name of Documentation tree from the parent tree and run git-ls-tree -d $tree_id_of_Documentation_tree to get something similar to what you can get from the current git-ls-tree HEAD Documentation ]
| | * | | ls-tree: major rewrite to do pathspecLinus Torvalds2005-11-28
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-ls-tree should be rewritten to use a pathspec the same way everybody else does. Right now it's the odd man out: if you do git-ls-tree HEAD divers/char drivers/ it will show the same files _twice_, which is not how pathspecs in general work. How about this patch? It breaks some of the git-ls-tree tests, but it makes git-ls-tree work a lot more like other git pathspec commands, and it removes more than 150 lines by re-using the recursive tree traversal (but the "-d" flag is gone for good, so I'm not pushing this too hard). Linus
| * | | format-patch: run diff in C localeJunio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise it would show incomplete line and binary markers in a locale dependent way. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | format-patch: do not abuse 3-dash marker line.Junio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before GIT version at the end of output we used a 3-dash marker; but 3-dash marker is special and should not be overused. Instead, use "-- " which is a standard practice in e-mails to signal the beginning of trailing garbage. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | format-patch: remove applies-to.Junio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attempt to help 3-way fallback by recording the tree object id for the entire pre-image was unnecessary, and we already have an better alternative in the form of per-blob "index" lines. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | applypatch: use "index" lines not "applies-to".Junio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This matches the 3-way fallback used by applypatch to use per-blob "index" lines, not "applies-to" tree object name, to match what git-am does. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | applymbox: typofix to enable -m option.Junio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The -m option to fall back on 3-way merge was not honoured at all because of a typo. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Do not attempt to access literal dirname "GIT_OBJECT_DIRECTORY".Tommi Virtanen2005-11-30
| |_|/ |/| | | | | | | | | | | | | | | | | Dereference the environment variable before using it. Signed-off-by: Tommi Virtanen <tv@inoi.fi> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-diff: do not turn off -p/-M with any diff options.Junio C Hamano2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user gives a diff option (e.g. --cached) to "git diff", we turned off the built-in default option -p, which is usually not what user wants to see. This commit makes lack of --name-status, --name-only nor -r to add -p, and lack of -B*, -C* nor -M* to add -M to the flags given to the underlying diff. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge http://www.kernel.org/pub/scm/gitk/gitkJunio C Hamano2005-11-29
|\ \ \
| * | | gitk: Add a preferences dialog with some basic stuffPaul Mackerras2005-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a lot more that could be put in, such as a selector for the font family etc., but this is a start. Signed-off-by: Paul Mackerras <paulus@samba.org>
* | | | [PATCH] Add tests for git-mv in subdirectoriesAlex Riesen2005-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Junio C Hamano, Sat, Nov 26, 2005 03:45:52 +0100: > I haven't seriously used git-mv myself, so > somebody needs to test it, and if it actually works and Ack on > it, please. It actually works in subdirs. Signed-off-by: Junio C Hamano <junkio@cox.net>