summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://repo.or.cz/git-guiJunio C Hamano2008-07-304-11/+36
|\ | | | | | | | | | | | | | | | | | | * git://repo.or.cz/git-gui: git-gui (Windows): Change wrapper to execdir 'libexec/git-core' git-gui (Windows): Switch to relative discovery of oguilib git-gui: Correct installation of library to be $prefix/share git-gui: Fix gitk search in $PATH to work on Windows git-gui: Preserve scroll position on reshow_diff. git-gui: Fix the Remote menu separator.
| * git-gui (Windows): Change wrapper to execdir 'libexec/git-core'Steffen Prohaska2008-07-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | git-gui needs bindir in PATH to be able to run 'git'. bindir however is not necessarily in PATH if started directly through a Windows shortcut. Therefore, we used to add the directory git-gui is located in. But with the new 'libexec/git-core' layout this directory is no longer identical to bindir. This commit modifies the wrapper script to discover the bindir and add it to PATH. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui (Windows): Switch to relative discovery of oguilibSteffen Prohaska2008-07-291-0/+1
| | | | | | | | | | | | | | | | | | | | Instead of using an absolute path, git-gui can discover its gui library using a relative path from execdir. We want to use the relative path discovery on MinGW to avoid issues with translation of absolute paths. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Correct installation of library to be $prefix/shareSteffen Prohaska2008-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always wanted the library for git-gui to install into the $prefix/share directory, not $prefix/libexec/share. All of the files in our library are platform independent and may be reused across systems, like any other content stored in the share directory. Our computation of where our library should install to was broken when git itself started installing to $prefix/libexec/git-core, which was one level down from where we expected it to be. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Fix gitk search in $PATH to work on WindowsShawn O. Pearce2008-07-291-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in 15430be5a1 ("Look for gitk in $PATH, not $LIBEXEC/git-core") git-gui learned to use [_which gitk] to locate where gitk's script is as Git 1.6 will install gitk to $prefix/bin (in $PATH) and all of the other tools are in $gitexecdir. This failed on Windows because _which adds the ".exe" suffix as it searches for the program on $PATH, under the assumption that we can only execute something from Tcl if it is a proper Windows executable. When scanning for gitk on Windows we need to omit the ".exe" suffix. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Preserve scroll position on reshow_diff.Alexander Gavrilov2008-07-271-4/+14
| | | | | | | | | | | | | | | | | | It is especially useful for Stage/Unstage Line, because they invoke full state scan and diff reload, which originally would reset the scroll position to the top of the file. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Fix the Remote menu separator.Alexander Gavrilov2008-07-271-0/+1
| | | | | | | | | | | | | | | | It was positioned incorrectly (offset by one position) if the menu had a tear-off handle. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Teach gitlinks to ie_modified() and ce_modified_check_fs()Junio C Hamano2008-07-301-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ie_modified() function is the workhorse for refresh_cache_entry(), i.e. checking if an index entry that is stat-dirty actually has changes. After running quicker check to compare cached stat information with results from the latest lstat(2) to answer "has modification" early, the code goes on to check if there really is a change by comparing the staged data with what is on the filesystem by asking ce_modified_check_fs(). However, this function always said "no change" for any gitlinks that has a directory at the corresponding path. This made ie_modified() to miss actual changes in the subproject. The patch fixes this first by modifying an existing short-circuit logic before calling the ce_modified_check_fs() function. It knows that for any filesystem entity to which ie_match_stat() says its data has changed, if its cached size is nonzero then the contents cannot match, which is a correct optimization only for blob objects. We teach gitlink objects to this special case, as we already know that any gitlink that ie_match_stat() says is modified is indeed modified at this point in the codepath. With the above change, we could leave ce_modified_check_fs() broken, but it also futureproofs the code by teaching it to use ce_compare_gitlink(), instead of assuming (incorrectly) that any directory is unchanged. Originally noticed by Alex Riesen on Cygwin. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Advertise the ability to abort a commitAnders Melchiorsen2008-07-302-3/+5
| | | | | | | | | | | | | | This treats aborting a commit more like a feature. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Support copy and rename detection in fast-export.Alexander Gavrilov2008-07-293-2/+81
| | | | | | | | | | | | | | | | | | | | | | | | Although it does not matter for Git itself, tools that export to systems that explicitly track copies and renames can benefit from such information. This patch makes fast-export output correct action logs when -M or -C are enabled. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | format-patch: Produce better output with --inline or --attachKevin Ballard2008-07-2910-3/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes two small changes to improve the output of --inline and --attach. The first is to write a newline preceding the boundary. This is needed because MIME defines the encapsulation boundary as including the preceding CRLF (or in this case, just LF), so we should be writing one. Without this, the last newline in the pre-diff content is consumed instead. The second change is to always write the line termination character (default: newline) even when using --inline or --attach. This is simply to improve the aesthetics of the resulting message. When using --inline an email client should render the resulting message identically to the non-inline version. And when using --attach this adds a blank line preceding the attachment in the email, which is visually attractive. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: Remove mentions of git-svnimport.Brian Gernhardt2008-07-291-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | git-svnimport is no longer supported, so don't mention it in the documentation. This also updates the description, removing the historical discussion, since it mostly dealt with how it differed from svnimport. The new description gives some starting points into the rest of the documentation. Noticed by Jurko Gospodnetić <jurko.gospodnetic@docte.hr> Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make it clear that push can take multiple refspecsAbhijit Menon-Sen2008-07-291-8/+9
| | | | | | | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | `git submodule add` now requires a <path>Abhijit Menon-Sen2008-07-291-4/+4
| | | | | | | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make use of stat.ctime configurableAlex Riesen2008-07-286-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A new configuration variable 'core.trustctime' is introduced to allow ignoring st_ctime information when checking if paths in the working tree has changed, because there are situations where it produces too much false positives. Like when file system crawlers keep changing it when scanning and using the ctime for marking scanned files. The default is to notice ctime changes. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | merge-base: die with an error message if not passed a commit refChristian Couder2008-07-281-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch "git merge-base" just exited with error code 1 and without an error message in case it was passed a ref to an object that is not a commit (for example a tree). This patch makes it "die" in this case with an error message. While at it, this patch also refactors the code to get the commit reference from an argument into a new "get_commit_reference" function. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t7001: fix "git mv" testJunio C Hamano2008-07-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The test assumed that we can keep the cached stat information fresh across rename(2); many filesystems however update st_ctime (and POSIX allows them to do so), and that assumption does not hold. We can explicitly refresh the index for the purpose of these tests. The only thing we are interested in is the staged contents and the mode bits are preserved across "git mv". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: clarify what is shown in "git-ls-files -s" outputJunio C Hamano2008-07-281-1/+1
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | run-command (Windows): Run dashless "git <cmd>"Steffen Prohaska2008-07-281-7/+4
| | | | | | | | | | | | | | | | | | We prefer running the dashless form, and POSIX side already does so; we should use it in MinGW's start_command(), too. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Acked-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Refactor, adding prepare_git_cmd(const char **argv)Steffen Prohaska2008-07-282-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | prepare_git_cmd(const char **argv) adds a first entry "git" to the array argv. The new array is allocated on the heap. It's the caller's responsibility to release it with free(). The code was already present in execv_git_cmd() but could not be used from outside. Now it can also be called for preparing the command list in the MinGW codepath in run-command.c. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-verify-tag: fix -v option parsingOlivier Marin2008-07-281-4/+5
| | | | | | | | | | | | | | | | Since the C rewrite, "git verify-tag -v" just does nothing instead of printing the usage message with an error. This patch fix the regression. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | ls-tree documentation: enhance notes on subdirectory and pathspec behaviourJunio C Hamano2008-07-281-4/+14
| | | | | | | | | | | | | | | | When run in a working copy subdirectory, git-ls-tree will automagically add the prefix to the pathspec, which can result in an unexpected behavior when the tree object accessed is not the root tree object. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Allow installing in the traditional wayJunio C Hamano2008-07-281-1/+4
| | | | | | | | | | | | | | | | | | | | In an earlier commit c70a8d9 (Makefile: Do not install a copy of 'git' in $(gitexecdir), 2008-07-21), we tried to avoid installing two git, one in /usr/bin/git and the other in /usr/libexec/git-core/git. It mistakenly removed the only copy of git when gitexecdir and bindir are set to the same directory, i.e. the traditional layout. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Allow building without any git installedJunio C Hamano2008-07-281-1/+1
| | | | | | | | | | | | | | | | | | This is a follow-up patch to 49fa65a (Allow the built-in exec path to be relative to the command invocation path, 2008-07-23). Without specific gitexecdir passed from the command line, git-gui's build procedure would try to figure out the value for it by running an installed git. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | init: handle empty "template" parameterJeff King2008-07-272-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user passes "--template=", then our template parameter is blank. Unfortunately, copy_templates() assumes it has at least one character, and does all sorts of bad things like reading from template[-1] and then proceeding to link all of '/' into the .git directory. This patch just checks for that condition in copy_templates and aborts. As a side effect, this means that --template= now has the meaning "don't copy any templates." Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | GIT 1.6.0-rc1v1.6.0-rc1Junio C Hamano2008-07-271-1/+18
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-mv: Keep moved index entries inactPetr Baudis2008-07-274-55/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rewrite of git-mv from a shell script to a builtin was perhaps a little too straightforward: the git add and git rm queues were emulated directly, which resulted in a rather complicated code and caused an inconsistent behaviour when moving dirty index entries; git mv would update the entry based on working tree state, except in case of overwrites, where the new entry would still have sha1 of the old file. This patch introduces rename_index_entry_at() into the index toolkit, which will rename an entry while removing any entries the new entry might render duplicate. This is then used in git mv instead of all the file queues, resulting in a major simplification of the code and an inevitable change in git mv -n output format. Also the code used to refuse renaming overwriting symlink with a regular file and vice versa; there is no need for that. A few new tests have been added to the testsuite to reflect this change. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-mv: Remove dead code branchPetr Baudis2008-07-271-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The path list builder had a branch for the case the source is not in index, but this can happen only if the source was a directory. However, in that case we have already expanded the list to the directory contents and set mode to WORKING_DIRECTORY, which is tested earlier. The patch removes the superfluous branch and adds an assert() instead. git-mv testsuite still passes. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | fsck: Don't require tmp_obj_ file names are 14 bytes in lengthShawn O. Pearce2008-07-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all temporary file creation routines will ensure 14 bytes are used to generate the temporary file name. In C Git this may be true, but alternate implementations such as jgit are not always able to generate a temporary file name with a specific prefix and also ensure the file name length is 14 bytes long. Since temporary files in a directory we are fsck'ing should be uncommon (as they are short lived only long enough for an active writer to finish writing the file and rename it) we shouldn't see these show up very often. Always using a prefixcmp() call and ignoring the length opens up room for other implementations to use different name generation schemes. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Avoid chdir() in list_commands_in_dir()Johannes Schindelin2008-07-271-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The function list_commands_in_dir() tried to be lazy and just chdir() to the directory which entries it listed, so that the check if the file is executable could be done on dir->d_name. However, there is no good reason to jump around wildly just to find all Git commands. Instead, have a strbuf and construct the full path dynamically. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-branch: fix -v for --[no-]mergedLars Hjemli2008-07-271-0/+15
| | | | | | | | | | | | | | | | | | | | | | After the optimization to --[no-]merged logic, the calculation of the width of the longest refname to be shown might become inaccurate (since the matching against merge_filter is performed after adding refs to ref_list). This patch forces a recalculation of maxwidth when it might be needed. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-branch: factor out merge_filter matchingLars Hjemli2008-07-271-5/+13
| | | | | | | | | | | | | | | | The logic for checking commits against merge_filter will be reused when we recalculate the maxwidth of refnames. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-branch: remove duplicated codeLars Hjemli2008-07-271-7/+2
| | | | | | | | | | | | | | | | The previous optimization to --[no-]merged ended up with some duplicated code which this patch removes. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rev-parse: Add support for the ^! and ^@ syntaxBjörn Steinbrink2008-07-272-0/+34
| | | | | | | | | | | | | | | | | | | | | | Those shorthands are explained in the rev-parse documentation but were not actually supported by rev-parse itself. gitk internally uses rev-parse to interpret its command line arguments, and being able to use these "limit with parents" syntax is handy there. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | make sure parsed wildcard refspec ends with slashJunio C Hamano2008-07-272-18/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A wildcard refspec is internally parsed into a refspec structure with src and dst strings. Many parts of the code assumed that these do not include the trailing "/*" when matching the wildcard pattern with an actual ref we see at the remote. What this meant was that we needed to make sure not just that the prefix matched, and also that a slash followed the part that matched. But a codepath that scans the result from ls-remote and finds matching refs forgot to check the "matching part must be followed by a slash" rule. This resulted in "refs/heads/b1" from the remote side to mistakenly match the source side of "refs/heads/b/*:refs/remotes/b/*" refspec. Worse, the refspec crafted internally by "git-clone", and a hardcoded preparsed refspec that is used to implement "git-fetch --tags", violated this "parsed widcard refspec does not end with slash" rule; simply adding the "matching part must be followed by a slash" rule then would have broken codepaths that use these refspecs. This commit changes the rule to require a trailing slash to parsed wildcard refspecs. IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as src = "refs/heads/b/" and dst = "refs/remotes/b/". This allows us to simplify the matching logic because we only need to do a prefixcmp() to notice "refs/heads/b/one" matches and "refs/heads/b1" does not. Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: More about how gitweb gets 'owner' of repositoryJakub Narebski2008-07-271-1/+2
| | | | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t6030 (bisect): work around Mac OS X "ls"Jonathan Nieder2008-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | t6030-bisect-porcelain.sh relies on "ls" exiting with nonzero status when asked to list nonexistent files. Unfortunately, /bin/ls on Mac OS X 10.3 exits with exit code 0. So look at its output instead. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation/git-submodule.txt: fix doubled wordCesar Eduardo Barros2008-07-271-1/+1
| | | | | | | | | | Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | bash completion: Add completion for 'git help'Lee Marlow2008-07-271-7/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename cached __git_commandlist to __git_porcelain_commandlist and add __git_all_commandlist that only filters out *--* helpers. Completions for 'git help' will use the __git_all_commandlist, while the __git_porcelain_commandlist is used for git command completion. Users who actually read man pages may want to see help for plumbing commands. Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: fix diff.external exampleAnders Melchiorsen2008-07-272-5/+7
| | | | | | | | | | | | | | | | The diff.external examples pass a flag to gnu-diff, but GNU diff does not follow the GIT_EXTERNAL_DIFF interface. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | bash completion: Add long options for 'git describe'Thomas Rast2008-07-271-0/+9
| | | | | | | | | | | | Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Clarify that "git log x.c y.h" lists commits that touch either fileAbhijit Menon-Sen2008-07-271-1/+1
| | | | | | | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge git://repo.or.cz/git-guiJunio C Hamano2008-07-275-21/+178
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * git://repo.or.cz/git-gui: git-gui: "Stage Line": Treat independent changes in adjacent lines better git-gui: Fix "Stage/Unstage Line" with one line of context. git-gui: Correct 'Visualize Branches' on Mac OS X to start gitk git-gui: Look for gitk in $PATH, not $LIBEXEC/git-core Add a menu item to invoke full copy detection in blame. Kill the blame back-end on window close. Add options to control the search for copies in blame. Fix pre-commit hooks under MinGW/MSYS
| * git-gui: "Stage Line": Treat independent changes in adjacent lines betterJohannes Sixt2008-07-261-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assume that we want to commit these states: Old state == HEAD Intermediate state New state -------------------------------------------------------- context before context before context before old 1 new 1 new 1 old 2 old 2 new 2 context after context after context after that is, want to commit two changes in this order: 1. transform "old 1" into "new 1" 2. transform "old 2" into "new 2" [This discussion and this patch is about this very case and one other case as outlined below; any other intermediate states that one could imagine are not affected by this patch.] Now assume further, that we have not staged and commited anything, but we have already changed the working file to the new state. Then we will see this hunk in the "Unstaged Changes": @@ -1,4 +1,4 @@ context before -old 1 -old 2 +new 1 +new 2 context after The obvious way to stage the intermediate state is to apply "Stage This Line" to "-old 1" and "+new 1". Unfortunately, this resulted in this intermediate state: context before old 2 new 1 context after which is not what we wanted. In fact, it was impossible to stage the intermediate state using "Stage Line". The crux was that if a "+" line was staged, then the "-" lines were converted to context lines and arranged *before* the "+" line in the forged hunk that we fed to 'git apply'. With this patch we now treat "+" lines that are staged differently. In particular, the "-" lines before the "+" block are moved *after* the staged "+" line. Now it is possible to get the correct intermediate state by staging "-old 1" and "+new 1". Problem solved. But there is a catch. Noticing that we didn't get the right intermediate state by staging "-old 1" and "+new 1", we could have had the idea to stage the complete hunk and to *unstage* "-old 2" and "+new 2". But... the result is the same. The reason is that there is the exact symmetric problem with unstaging the last "-" and "+" line that are in adjacent blocks of "-" and "+" lines. This patch does *not* change the way in which "-" lines are *unstaged*. Why? Because if we did (i.e. move "+" lines before the "-" line after converting them to context lines), then it would be impossible to stage this intermediate state: context before old 1 new 2 context after that is, it would be impossible to stage the two independet changes in the opposite order. Let's look at this case a bit further: The obvious way to get this intermediate state would be to apply "Stage This Line" to "-old 2" and "+new 2". Before this patch, this worked as expected. With this patch, it does not work as expected, but it can still be achieved by first staging the entire hunk, then *unstaging* "-old 1" and "+new 1". In summary, this patch makes a common case possible, at the expense that a less common case is made more complicated for the user. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Fix "Stage/Unstage Line" with one line of context.Johannes Sixt2008-07-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To "Stage/Unstage Line" we construct a patch that contains exactly one change (either addition or removal); the hunk header was forged by counting the old side and adjusting the count by +/-1 for the new side. But when we counted the context we never counted the changed line itself. If the hunk had only one removal line and one line of context, like this: @@ -1,3 +1,2 @@ context 1 -removal context 2 We had constructed this patch: @@ -1,2 +1,1 @@ context 1 -removal context 2 which does not apply because git apply deduces that it must apply at the end of the file. ("context 2" is considered garbage and ignored.) The fix is that removal lines must be counted towards the context of the old side. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Correct 'Visualize Branches' on Mac OS X to start gitkShawn O. Pearce2008-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In Git 1.6 and later gitk is in $prefix/bin while git-gui and all of the other commands are in $gitexecdir, which is typically not the same as $prefix/bin. So we cannot launch $gitexecdir/gitk and expect it to actually start gitk properly. By allowing git-gui to locate the script via $PATH and then using exactly that path when we source it during the application start we can correctly run gitk on any Git 1.5 or later. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * git-gui: Look for gitk in $PATH, not $LIBEXEC/git-coreAbhijit Menon-Sen2008-07-251-3/+3
| | | | | | | | | | Signed-off-by: Abhijit Menon-Sen <ams@toroid.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * Add a menu item to invoke full copy detection in blame.Alexander Gavrilov2008-07-161-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a context menu item to invoke blame -C -C -C on a chunk of the file. The results are used to update the 'original location' column of the blame display. The chunk is computed as the smallest line range that covers both the 'last change' and 'original location' ranges of the line that was clicked to open the menu. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * Kill the blame back-end on window close.Alexander Gavrilov2008-07-162-4/+26
| | | | | | | | | | | | | | | | | | | | | | Currently 'git-gui blame' does not kill its back-end process, hoping that it will die anyway when the pipe is closed. However, in some cases the process works for a long time without producing any output. This behavior results in a runaway CPU hog. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * Add options to control the search for copies in blame.Alexander Gavrilov2008-07-163-8/+16
| | | | | | | | | | | | | | | | | | On huge repositories, -C -C can be way too slow to be unconditionally enabled, and it can also be useful to control its precision. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>