aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* userdiff: require explicitly allowing textconvJeff King2008-10-26
| | | | | | | | | | | | | | | | | | | | Diffs that have been produced with textconv almost certainly cannot be applied, so we want to be careful not to generate them in things like format-patch. This introduces a new diff options, ALLOW_TEXTCONV, which controls this behavior. It is off by default, but is explicitly turned on for the "log" family of commands, as well as the "diff" porcelain (but not diff-* plumbing). Because both text conversion and external diffing are controlled by these diff options, we can get rid of the "plumbing versus porcelain" distinction when reading the config. This was an attempt to control the same thing, but suffered from being too coarse-grained. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refactor userdiff textconv codeJeff King2008-10-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original implementation of textconv put the conversion into fill_mmfile. This was a bad idea for a number of reasons: - it made the semantics of fill_mmfile unclear. In some cases, it was allocating data (if a text conversion occurred), and in some cases not (if we could use the data directly from the filespec). But the caller had no idea which had happened, and so didn't know whether the memory should be freed - similarly, the caller had no idea if a text conversion had occurred, and so didn't know whether the contents should be treated as binary or not. This meant that we incorrectly guessed that text-converted content was binary and didn't actually show it (unless the user overrode us with "diff.foo.binary = false", which then created problems in plumbing where the text conversion did _not_ occur) - not all callers of fill_mmfile want the text contents. In particular, we don't really want diffstat, whitespace checks, patch id generation, etc, to look at the converted contents. This patch pulls the conversion code directly into builtin_diff, so that we only see the conversion when generating an actual patch. We also then know whether we are doing a conversion, so we can check the binary-ness and free the data from the mmfile appropriately (the previous version leaked quite badly when text conversion was used) Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add userdiff textconv testsJeff King2008-10-26
| | | | | | | | | | | | | | | | | | | These tests provide a basic sanity check that textconv'd files work. The tests try to describe how this configuration _should_ work; thus some of the tests are marked to expect failure. In particular, we fail to actually textconv anything because the 'diff.foo.binary' config option is not set, which will be fixed in the next patch. This also means that some "expect_failure" tests actually seem to be fixed; in reality, this is just because textconv is broken and its failure mode happens to make these tests work. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* document the diff driver textconv featureJeff King2008-10-26
| | | | | | | | | | | | This patch also changes the term "custom diff driver" to "external diff driver"; now that there are more facets of a "custom driver" than just external diffing, it makes sense to refer to the configuration of "diff.foo.*" as the "foo diff driver", with "diff.foo.command" as the "external driver for foo". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* diff: add missing static declarationJeff King2008-10-26
| | | | | | | | This function isn't used outside of diff.c; the 'static' was simply overlooked in the original writing. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* submodule: fix some non-portable grep invocationsJeff King2008-10-22
| | | | | | | | Not all greps support "-e", but in this case we can easily convert it to a single extended regex. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-remote: list branches in vertical listsJohannes Sixt2008-10-22
| | | | | | | | | | | | | Previously, branches were listed on a single line in each section. But if there are many branches, then horizontal, line-wrapped lists are very inconvenient to scan for a human. This makes the lists vertical, i.e one branch per line is printed. Since "git remote" is porcelain, we can easily make this backwards-incompatible change. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rm: loosen safety valve for empty filesJeff King2008-10-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a file is different between the working tree copy, the index, and the HEAD, then we do not allow it to be deleted without --force. However, this is overly tight in the face of "git add --intent-to-add": $ git add --intent-to-add file $ : oops, I don't actually want to stage that yet $ git rm --cached file error: 'empty' has staged content different from both the file and the HEAD (use -f to force removal) $ git rm -f --cached file Unfortunately, there is currently no way to distinguish between an empty file that has been added and an "intent to add" file. The ideal behavior would be to disallow the former while allowing the latter. This patch loosens the safety valve to allow the deletion only if we are deleting the cached entry and the cached content is empty. This covers the intent-to-add situation, and assumes there is little harm in not protecting users who have legitimately added an empty file. In many cases, the file will still be empty, in which case the safety valve does not trigger anyway (since the content remains untouched in the working tree). Otherwise, we do remove the fact that no content was staged, but given that the content is by definition empty, it is not terribly difficult for a user to recreate it. However, we still document the desired behavior in the form of two tests. One checks the correct removal of an intent-to-add file. The other checks that we still disallow removal of empty files, but is marked as expect_failure to indicate this compromise. If the intent-to-add feature is ever extended to differentiate between normal empty files and intent-to-add files, then the safety valve can be re-tightened. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'jk/diff-convfilter'Junio C Hamano2008-10-21
|\ | | | | | | | | | | | | | | * jk/diff-convfilter: diff: add filter for converting binary to text diff: introduce diff.<driver>.binary diff: unify external diff and funcname parsing code t4012: use test_cmp instead of cmp
| * diff: add filter for converting binary to textJeff King2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When diffing binary files, it is sometimes nice to see the differences of a canonical text form rather than either a binary patch or simply "binary files differ." Until now, the only option for doing this was to define an external diff command to perform the diff. This was a lot of work, since the external command needed to take care of doing the diff itself (including mode changes), and lost the benefit of git's colorization and other options. This patch adds a text conversion option, which converts a file to its canonical format before performing the diff. This is less flexible than an arbitrary external diff, but is much less work to set up. For example: $ echo '*.jpg diff=exif' >>.gitattributes $ git config diff.exif.textconv exiftool $ git config diff.exif.binary false allows one to see jpg diffs represented by the text output of exiftool. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * diff: introduce diff.<driver>.binaryJeff King2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "diff" gitattribute is somewhat overloaded right now. It can say one of three things: 1. this file is definitely binary, or definitely not (i.e., diff or !diff) 2. this file should use an external diff engine (i.e., diff=foo, diff.foo.command = custom-script) 3. this file should use particular funcname patterns (i.e., diff=foo, diff.foo.(x?)funcname = some-regex) Most of the time, there is no conflict between these uses, since using one implies that the other is irrelevant (e.g., an external diff engine will decide for itself whether the file is binary). However, there is at least one conflicting situation: there is no way to say "use the regular rules to determine whether this file is binary, but if we do diff it textually, use this funcname pattern." That is, currently setting diff=foo indicates that the file is definitely text. This patch introduces a "binary" config option for a diff driver, so that one can explicitly set diff.foo.binary. We default this value to "don't know". That is, setting a diff attribute to "foo" and using "diff.foo.funcname" will have no effect on the binaryness of a file. To get the current behavior, one can set diff.foo.binary to true. This patch also has one additional advantage: it cleans up the interface to the userdiff code a bit. Before, calling code had to know more about whether attributes were false, true, or unset to determine binaryness. Now that binaryness is a property of a driver, we can represent these situations just by passing back a driver struct. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * diff: unify external diff and funcname parsing codeJeff King2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both sets of code assume that one specifies a diff profile as a gitattribute via the "diff=foo" attribute. They then pull information about that profile from the config as diff.foo.*. The code for each is currently completely separate from the other, which has several disadvantages: - there is duplication as we maintain code to create and search the separate lists of external drivers and funcname patterns - it is difficult to add new profile options, since it is unclear where they should go - the code is difficult to follow, as we rely on the "check if this file is binary" code to find the funcname pattern as a side effect. This is the first step in refactoring the binary-checking code. This patch factors out these diff profiles into "userdiff" drivers. A file with "diff=foo" uses the "foo" driver, which is specified by a single struct. Note that one major difference between the two pieces of code is that the funcname patterns are always loaded, whereas external drivers are loaded only for the "git diff" porcelain; the new code takes care to retain that situation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * t4012: use test_cmp instead of cmpJeff King2008-10-18
| | | | | | | | | | | | | | | | This makes erroneous output slightly easier to see. We also flip the argument order to match our usual style. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge branch 'js/maint-fetch-update-head'Junio C Hamano2008-10-21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * js/maint-fetch-update-head: pull: allow "git pull origin $something:$current_branch" into an unborn branch Fix fetch/pull when run without --update-head-ok Conflicts: t/t5510-fetch.sh
| * | pull: allow "git pull origin $something:$current_branch" into an unborn branchJunio C Hamano2008-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some misguided documents floating on the Net suggest this sequence: mkdir newdir && cd newdir git init git remote add origin $url git pull origin master:master "git pull" has known about misguided "pull" that lets the underlying fetch update the current branch for a long time. It also has known about "git pull origin master" into a branch yet to be born. These two workarounds however were not aware of the existence of each other and did not work well together. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Fix fetch/pull when run without --update-head-okJohannes Schindelin2008-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some confusing tutorials suggested that it would be a good idea to fetch into the current branch with something like this: git fetch origin master:master (or even worse: the same command line with "pull" instead of "fetch"). While it might make sense to store what you want to pull, it typically is plain wrong when the current branch is "master". This should only be allowed when (an incorrect) "git pull origin master:master" tries to work around by giving --update-head-ok to underlying "git fetch", and otherwise we should refuse it, but somewhere along the lines we lost that behavior. The check for the current branch is now _only_ performed in non-bare repositories, which is an improvement from the original behaviour. Some newer tests were depending on the broken behaviour of "git fetch" this patch fixes, and have been adjusted. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/maint-co-track'Junio C Hamano2008-10-21
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-co-track: Enhance hold_lock_file_for_{update,append}() API demonstrate breakage of detached checkout with symbolic link HEAD Fix "checkout --track -b newbranch" on detached HEAD Conflicts: builtin-commit.c
| * | | Enhance hold_lock_file_for_{update,append}() APIJunio C Hamano2008-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the "die_on_error" boolean parameter to a mere "flags", and changes the existing callers of hold_lock_file_for_update/append() functions to pass LOCK_DIE_ON_ERROR. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | demonstrate breakage of detached checkout with symbolic link HEADJunio C Hamano2008-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When core.prefersymlinkrefs is in use, detaching the HEAD by checkout incorrectly clobbers the tip of the current branch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Fix "checkout --track -b newbranch" on detached HEADJunio C Hamano2008-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test to make sure that checkout fails when --track was asked for and we cannot set up tracking information in t7201 was wrong, and it turns out that the implementation for that feature itself was buggy. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'rs/alloc-ref'Junio C Hamano2008-10-21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/alloc-ref: make alloc_ref_from_str() the new alloc_ref() use alloc_ref_from_str() everywhere add alloc_ref_with_prefix()
| * | | | make alloc_ref_from_str() the new alloc_ref()René Scharfe2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With all calls to alloc_ref() gone, we can remove it and then we're free to give alloc_ref_from_str() the shorter name. It's a much nicer interface, as the callers always need to have a name string when they allocate a ref anyway and don't need to calculate and pass its length+1 any more. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | use alloc_ref_from_str() everywhereRené Scharfe2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace pairs of alloc_ref() and strcpy() with alloc_ref_from_str(), simplifying the code. In connect.c, also a pair of alloc_ref() and memcpy() is replaced -- the additional cost of a strlen() call should not have too much of an impact. Consistency and simplicity are more important. In remote.c, the code was allocating 11 bytes more than needed for the name part, but I couldn't see them being used for anything. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | add alloc_ref_with_prefix()René Scharfe2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In three cases in remote.c, a "raw" ref is allocated using alloc_ref() and then its is constructed using sprintf(). Clean it up by adding a helper function, alloc_ref_with_prefix(), which creates a composite name. Use it in alloc_ref_from_str(), too, as it simplifies the code. Open code alloc_ref() in alloc_ref_with_prefix(), as the former is going to be removed in the patch after the next. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jk/fix-ls-files-other'Junio C Hamano2008-10-21
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jk/fix-ls-files-other: refactor handling of "other" files in ls-files and status
| * \ \ \ \ Merge branch 'jk/maint-ls-files-other' into jk/fix-ls-files-otherJunio C Hamano2008-10-17
| |\ \ \ \ \ | | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/maint-ls-files-other: refactor handling of "other" files in ls-files and status Conflicts: read-cache.c
| | * | | | refactor handling of "other" files in ls-files and statusJeff King2008-10-17
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the "git status" display code was originally converted to C, we copied the code from ls-files to discover whether a pathname returned by read_directory was an "other", or untracked, file. Much later, 5698454e updated the code in ls-files to handle some new cases caused by gitlinks. This left the code in wt-status.c broken: it would display submodule directories as untracked directories. Nobody noticed until now, however, because unless status.showUntrackedFiles was set to "all", submodule directories were not actually reported by read_directory. So the bug was only triggered in the presence of a submodule _and_ this config option. This patch pulls the ls-files code into a new function, cache_name_is_other, and uses it in both places. This should leave the ls-files functionality the same and fix the bug in status. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jc/maint-reset-remove-unmerged-new'Junio C Hamano2008-10-21
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/maint-reset-remove-unmerged-new: reset --hard/read-tree --reset -u: remove unmerged new paths
| * | | | | reset --hard/read-tree --reset -u: remove unmerged new pathsJunio C Hamano2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When aborting a failed merge that has brought in a new path using "git reset --hard" or "git read-tree --reset -u", we used to first forget about the new path (via read_cache_unmerged) and then matched the working tree to what is recorded in the index, thus ending up leaving the new path in the work tree. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'maint'Junio C Hamano2008-10-21
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: GIT 1.6.0.3 rehabilitate 'git index-pack' inside the object store
| * | | | | | GIT 1.6.0.3v1.6.0.3Junio C Hamano2008-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | rehabilitate 'git index-pack' inside the object storeNicolas Pitre2008-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before commit d0b92a3f6e it was possible to run 'git index-pack' directly in the .git/objects/pack/ directory. Restore that ability. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'maint'Junio C Hamano2008-10-20
|\ \ \ \ \ \ \ | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | * maint: Fix testcase failure when extended attributes are in use
| * | | | | | Fix testcase failure when extended attributes are in useJunio C Hamano2008-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 06cbe855 (Make core.sharedRepository more generic, 2008-04-16) made several testcases in t1301-shared-repo.sh which fail if on a system which creates files with extended attributes (e.g. SELinux), since ls appends a '+' sign to the permission set in such cases. In fact, POSIX.1 allows ls to add a single printable character after the usual 3x3 permission bits to show that an optional alternate/additional access method is associated with the path. This fixes the testcase to strip any such sign prior to verifying the permission set. Signed-off-by: Junio C Hamano <gitster@pobox.com> Tested-by: Deskin Miller <deskinm@umich.edu>
* | | | | | | workflows documentation: fix link to git-request-pull[1]Lee Marlow2008-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | bash completion: Add 'workflows' to 'git help'Lee Marlow2008-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Completion for new workflow documentation introduced in f948dd8 Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano2008-10-20
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/gitk/gitk: gitk: Turn short SHA1 names into links too gitk: Regenerate .po files gitk: New way of constructing menus that allows for Alt+letter accelerators gitk: Bind Key-Return to create on new branch dialog gitk: Fix binding for <Return> in sha1 entry field gitk: Clean up file encoding code and add enable/disable option gitk: Implement batch lookup and caching of encoding attrs gitk: Enhance file encoding support gitk: Add untranslated error messages to translation gitk: Fix a bug in collapsing deeply nested trees gitk: Use <Button-2> for context menus on OSX
| * | | | | | | gitk: Turn short SHA1 names into links tooPaul Mackerras2008-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the link detection logic to accept strings of between 6 and 40 hex characters as a possible SHA1 ID of another commit, rather than insisting on seeing the full 40 hex characters. To make the logic that turns a possible link into an actual link work with abbreviated IDs, this changes the way the commitinterest array is used, and puts the code that deals with it in a pair of new functions. The commitinterest array is now indexed by just the first 4 characters of the interesting SHA1 ID, and each element is a list of id + command pairs. This also pulls out the logic for expanding an abbreviated SHA1 to the list of matching full IDs into its own function (the way it is done is still the same slow way it was done before, which should be improved some day). This also fixes the bug where clicking on a link would take you to the wrong commit if the line number of the target had changed since the link was made. This is based on a patch by Linus Torvalds, but totally rewritten by me. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Regenerate .po filesPaul Mackerras2008-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the result of running make update-po and removing or fixing the strings that were fuzzily matched. The ones that were fixed were the ones where the only change was "git rev-list" to "git log", and the "about gitk" message where the copyright year got updated. To get xgettext to see the menu labels as needing translation, it was necessary for arrange for them to be preceded by "mc". This therefore changes makemenu to ignore the first element in each menu item so that it can be "mc" in the makemenu call. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: New way of constructing menus that allows for Alt+letter acceleratorsPaul Mackerras2008-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is inspired by patches from Robin Rosenberg but takes a different approach. This adds a "makemenu" procedure for constructing menus that allows the menu layout to be specified in a clear fashion, and provides one place where the alt+letter accelerators can be detected and handled. The alt+letter accelerator is specified by putting an ampersand (&) before the letter for the accelerator in the menu item name. (Two ampersands in succession produce one ampersand in the menu item as it appears on screen.) This is handled in makemenu. We also add an mca procedure which is like mc but also does the ampersand translation, for use when we want to refer to a menu item by name. The mca name and the locations where we use it were shamelessly stolen from Robin Rosenberg's patch. This doesn't actually add any alt+letter accelerators yet. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Bind Key-Return to create on new branch dialogRichard Quirk2008-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Return key can now be used as well as pressing the Create button from the dialog box that is shown when selecting "Create new branch". Signed-off-by: Richard Quirk <richard.quirk@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Fix binding for <Return> in sha1 entry fieldPaul Mackerras2008-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a break so that gitk doesn't go and execute the global binding for <Return> (i.e. find next) when the user presses the return key in the sha1 entry field to indicate that gitk should jump to the commit identified by what they just put into the sha1 field. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Clean up file encoding code and add enable/disable optionPaul Mackerras2008-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds an option allowing the user to select whether gitk should look up per-file encoding settings using git check-attr or not. If not, gitk uses the global encoding set in the git config (as reported by git config --get gui.encoding) for all files, or if that is not set, then the system encoding. The option is controlled by a checkbox in the Edit->Preferences window, and defaults to off for now because git check-attr is so slow. When the user turns it on we discard any cached diff file lists in treediffs, because we may not have encodings cached for the files listed in those lists, meaning that getblobdiffline will do it for each file, which will be really really slow. This adjusts the limit of how many paths cache_gitattr passes to each instance of git check-attr depending on whether we're running under windows or not. Passing only 30 doesn't effectively amortize the startup costs of git check-attr, but it's all we can do under windows because of the 32k limit on arguments to a command. Under other OSes we pass up to 1000. Similarly we adjust how many lines gettreediffline processes depending on whether we are doing per-file encodings so that we don't run for too long. When we are, 500 seems to be a reasonable limit, leading to gettreediffline taking about 60-70ms under Linux (almost all of which is in cache_gitattr, unfortunately). This means that we can take out the update call in cache_gitattr. This adds a simple cache on [tclencoding]. Now that we get repeated calls to translate the same encoding, this is useful. This reindents the new code added in the last couple of commits to conform to the gitk 4-space indent and makes various other improvements: use regexp in gitattr and cache_gitattr instead of split + join + regsub, make gui_encoding be the value from [tclencoding] to avoid having to do [tcl_encoding $gui_encoding] in each call to get_path_encoding, and print a warning message at startup if $gui_encoding isn't supported by Tcl. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Implement batch lookup and caching of encoding attrsAlexander Gavrilov2008-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the diff contains thousands of files, calling git-check-attr once per file is very slow. With this patch gitk does attribute lookup in batches of 30 files while reading the diff file list, which leads to a very noticeable speedup. It may be possible to reimplement this even more efficiently, if git-check-attr is modified to support a --stdin-paths option. Additionally, it should quote the ':' character in file paths, or provide a more robust way of column separation. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Enhance file encoding supportAlexander Gavrilov2008-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the encoding to be specified for file contents and used when displaying files and diffs in the bottom-left pane. When displaying diffs, the encoding for each diff hunk is that for the file that the diff hunk is from, so it can change through the course of the diff. The encoding for file contents is determined as follows: - File encoding defaults to the system encoding. - It can be overridden by setting the gui.encoding option. - Finally, the 'encoding' attribute is checked on per-file basis; it has the last word. Note: Since git-check-attr does not provide support for reading attributes from trees, attribute lookup is done using files from the working directory. This also extends the range of supported encoding names, adding ShiftJIS and Shift-JIS as aliases for Shift_JIS, and allowing cp-*, cp_*, ibm-*, ibm_*, jis-* and jis_* as aliases for cp*, ibm* and jis* respectively. This also fixes some bugs in handling of non-ASCII filenames. Core git apparently supports only locale-encoded filenames, so processing is done using the system encoding. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Tested-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Add untranslated error messages to translationChristian Stimming2008-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Fix a bug in collapsing deeply nested treesAlexander Gavrilov2008-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To reproduce: expand a tree like this, then collapse A: +A +B C D The result is: -A C D I.e. sub-nodes expanded from the last sub-node of the item being collapsed are not removed. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | | gitk: Use <Button-2> for context menus on OSXPaul Mackerras2008-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An OSX user has reported that gitk's context menus are not usable under OSX because it doesn't provide a way to generate <Button-3> events. Users can generate <Button-2> events with command+click, so use that for the context menus instead on OSX. Signed-off-by: Paul Mackerras <paulus@samba.org>
* | | | | | | | document "intent to add" option to git-addJeff King2008-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was added by 3942581 but never documented. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'sh/maint-rebase3'Junio C Hamano2008-10-19
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sh/maint-rebase3: rebase--interactive: fix parent rewriting for dropped commits