summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-02-16git-help--browse: improve browser support under OS XJay Soffian
/usr/bin/open <document> is used under OS X to open a document as if the user had double-clicked on the file's icon (i.e. HTML files are opened w/the user's default browser). Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16Merge branch 'maint'Junio C Hamano
* maint: commit: discard index after setting up partial commit filter-branch: handle filenames that need quoting diff: Fix miscounting of --check output hg-to-git: fix parent analysis mailinfo: feed only one line to handle_filter() for QP input diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver" Add "const" qualifier to "char *excludes_file". Add "const" qualifier to "char *editor_program". Add "const" qualifier to "char *pager_program". config: add 'git_config_string' to refactor string config variables. diff.c: remove useless check for value != NULL fast-import: check return value from unpack_entry() Validate nicknames of remote branches to prohibit confusing ones diff.c: replace a 'strdup' with 'xstrdup'. diff.c: fixup garding of config parser from value=NULL
2008-02-16commit: discard index after setting up partial commitJeff King
There may still be some entries from the original index that should be discarded before we show the status. In particular, if a file was added in the index but not included in the partial commit, it would still show up in the status listing as staged for commit. Ultimately the correct fix is to keep the two states in separate index_state variables. Then we can avoid having to reload the cache from the temporary file altogether, and just point wt_status_print at the correct index. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16filter-branch: handle filenames that need quotingJunio C Hamano
The command used a very old fashioned construct to extract filenames out of diff-index and ended up corrupting the output. We can simply use --name-only and pipe into --stdin mode of update-index. It's been like that for the past 2 years or so since a94d994 (update-index: work with c-quoted name). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16http-push: avoid a needless gotoJohannes Schindelin
There was a goto, and while it is not half as harmful as some people believe, it was unnecessary here. So remove it for readability. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16http-push: do not get confused by submodulesJohannes Schindelin
When encountering submodules in a tree, http-push should not try sending the respective object. Instead, it should ignore it. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16http-push: avoid invalid memory accessesJohannes Schindelin
Before objects are sent, the respective ref is locked. However, without this patch, the lock is lifted before the last object for that ref was sent. As a consequence, the lock data was accessed after the lock structure was free()d. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16diff: Fix miscounting of --check outputJunio C Hamano
c1795bb (Unify whitespace checking) incorrectly made the checking function return without incrementing the line numbers when there is no whitespace problem is found on a '+' line. This resurrects the earlier behaviour. Noticed and reported by Jay Soffian. The test script was stolen from Jay's independent fix. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16hg-to-git: fix parent analysisStelian Pop
Fix a bug in the hg-to-git convertor introduced by commit 1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset parents, 'hg log' returns an extra space at the end of the line, which confuses the .split(' ') based tokenizer: Traceback (most recent call last): File "hg-to-git.py", line 123, in <module> hgchildren[mparent] += ( str(cset), ) KeyError: '' Signed-off-by: Stelian Pop <stelian@popies.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16mailinfo: feed only one line to handle_filter() for QP inputJay Soffian
The function is intended to be fed one logical line at a time to inspect, but a QP encoded raw input line can have more than one lines, just like BASE64 encoded one. Quoting LF as =0A may be unusual but RFC2045 allows it. The issue was noticed and fixed by Jay Soffian. JC added a test to protect the fix from regressing later. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"Christian Couder
Also use "git_config_string" to simplify code where "cmd" is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16Add "const" qualifier to "char *excludes_file".Christian Couder
Also use "git_config_string" to simplify "config.c" code where "excludes_file" is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16Add "const" qualifier to "char *editor_program".Christian Couder
Also use "git_config_string" to simplify "config.c" code where "editor_program" is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16Add "const" qualifier to "char *pager_program".Christian Couder
Also use "git_config_string" to simplify "config.c" code where "pager_program" is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16config: add 'git_config_string' to refactor string config variables.Christian Couder
In many places we just check if a value from the config file is not NULL, then we duplicate it and return 0. This patch introduces the new 'git_config_string' function to do that. This function is also used to refactor some code in 'config.c'. Refactoring other files is left for other patches. Also not all the code in "config.c" is refactored, because the function takes a "const char **" as its first parameter, but in many places a "char *" is used instead of a "const char *". (And C does not allow using a "char **" instead of a "const char **" without a warning.) Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16diff.c: remove useless check for value != NULLChristian Couder
It is not necessary to check if value != NULL before calling 'parse_lldiff_command' as there is already a check inside this function. By the way this patch also improves the existing check inside 'parse_lldiff_command' by using: return config_error_nonbool(var); instead of: return error("%s: lacks value", var); Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16fast-import: check return value from unpack_entry()Shawn O. Pearce
If the tree object we have asked for is deltafied in the packfile and the delta did not apply correctly or was not able to be decompressed from the packfile then we can get back NULL instead of the tree data. This is (part of) the reason why read_sha1_file() can return NULL, so we need to also handle it the same way. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15Validate nicknames of remote branches to prohibit confusing onesDaniel Barkalow
The original problem was that the parsers for configuration files were getting confused by seeing as nicknames remotes that involved directory-changing characters. In particular, the branches config file for ".." was particularly mystifying on platforms that can open directories and read odd data from them. The validation function was written by Junio Hamano (with a typo corrected). Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15diff.c: replace a 'strdup' with 'xstrdup'.Christian Couder
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15diff.c: fixup garding of config parser from value=NULLJunio C Hamano
Christian Couder noticed that there still were a handcrafted error() call that we should have converted to config_error_nonbool() where parse_lldiff_command() parses the configuration file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-14git-gui: Correct size of dictionary name widget in options dialogShawn O. Pearce
We don't need to fill this entire horizontal cavity, it looks really bad on some platforms to stretch the widget out to fill the window. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-14git-gui: Paper bag fix bad string length call in spellcheckerShawn O. Pearce
We don't want the list length, we need the string length. Found due to a bad " character discovered in the text and Tcl throwing 'unmatched open quote in list'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-13Add "--show-all" revision walker flag for debuggingLinus Torvalds
It's really not very easy to visualize the commit walker, because - on purpose - it obvously doesn't show the uninteresting commits! This adds a "--show-all" flag to the revision walker, which will make it show uninteresting commits too, and they'll have a '^' in front of them (it also fixes a logic error for !verbose_header for boundary commits - we should show the '-' even if left_right isn't shown). A separate patch to gitk to teach it the new '^' was sent to paulus. With the change in place, it actually is interesting even for the cases that git doesn't have any problems with, ie for the kernel you can do: gitk -d --show-all v2.6.24.. and you see just how far down it has to parse things to see it all. The use of "-d" is a good idea, since the date-ordered toposort is much better at showing why it goes deep down (ie the date of some of those commits after 2.6.24 is much older, because they were merged from trees that weren't rebased). So I think this is a useful feature even for non-debugging - just to visualize what git does internally more. When it actually breaks out due to the "everybody_uninteresting()" case, it adds the uninteresting commits (both the one it's looking at now, and the list of pending ones) to the list This way, we really list *all* the commits we've looked at. Because we now end up listing commits we may not even have been parsed at all "show_log" and "show_commit" need to protect against commits that don't have a commit buffer entry. That second part is debatable just how it should work. Maybe we shouldn't show such entries at all (with this patch those entries do get shown, they just don't get any message shown with them). But I think this is a useful case. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13[PATCH] gitk: Heed the lines of context in merge commitsJohannes Sixt
There is an edit box where the number of context lines can be chosen. But it was only used when regular diffs were displayed, not for merge commits. This fixes it. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-13Merge branch 'maint'Junio C Hamano
* maint: config: add test cases for empty value and no value config variables. cvsimport: have default merge regex also match beginning of commit message git clone -s documentation: force a new paragraph for the NOTE status: suggest "git rm --cached" to unstage for initial commit Protect get_author_ident_from_commit() from filenames in work tree upload-pack: Initialize the exec-path. bisect: use verbatim commit subject in the bisect log git-cvsimport.txt: fix '-M' description. Revert "pack-objects: only throw away data during memory pressure"
2008-02-13config: add test cases for empty value and no value config variables.Christian Couder
The tests in 't1300-repo-config.sh' did not check what happens when an empty value like the following is used in the config file: [emptyvalue] variable = Also it was not checked that a variable with no value like the following: [novalue] variable gives a boolean "true" value, while an ampty value gives a boolean "false" value. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13cvsimport: have default merge regex also match beginning of commit messageGerrit Pape
The default value of @mergerx uses \W, which matches a non-word character; this means that commit messages like "Merging FOO" are not matched by default; using \b, which matches a word boundary, instead of \W fixes that. This change was suggested by Frédéric Brière through http://bugs.debian.org/463468 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13git clone -s documentation: force a new paragraph for the NOTEMiklos Vajna
It should be loud and clear. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13status: suggest "git rm --cached" to unstage for initial commitJeff King
It makes no sense to suggest "git reset HEAD" since we have no HEAD commit. This actually used to work but regressed in f26a0012. wt_status_print_cached_header was updated to take the whole wt_status struct rather than just the reference field. Previously the various code paths were sometimes sending in s->reference and sometimes sending in NULL, making the decision on whether this was an initial commit before we even got to this function. Now we must check the initial flag here. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13hard-code the empty tree objectJeff King
Now any commands may reference the empty tree object by its sha1 (4b825dc642cb6eb9a060e54bf8d69288fbee4904). This is useful for showing some diffs, especially for initial commits. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13Protect get_author_ident_from_commit() from filenames in work treeJunio C Hamano
We used to use "cat-file commit $commit" to extract the original author information from existing commit, but an earlier commit 5ac2715 (Consistent message encoding while reusing log from an existing commit) changed it to use "git show -s $commit". If you have a file in your work tree that can be interpreted as a valid object name (e.g. "HEAD"), this conversion will not work. Disambiguate by marking the end of revision parameter on the comand line with an explicit "--" to fix this. This breakage is most visible with rebase when a file called "HEAD" exists in the worktree. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13upload-pack: Initialize the exec-path.Johannes Sixt
Since git-upload-pack has to spawn git-pack-objects, it has to make sure that the latter can be found in the PATH. Without this patch an attempt to clone or pull via ssh from a server fails if the git tools are not in the standard PATH on the server even though git clone or git pull were invoked with --upload-pack=/path/to/git-upload-pack. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13bisect: use verbatim commit subject in the bisect logJohannes Schindelin
Due to a typo, the commit subject was shell expanded in the bisect log. That is, if you had some shell pattern in the commit subject, bisect would happily put all matching file names into the log. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Tested-by: Frans Pop <elendil@planet.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13git-cvsimport.txt: fix '-M' description.Sergei Organov
Fix '-M' description. Old one reads as if the user can somehow "see" the default regex when using -M along with -m. Signed-off-by: Sergei Organov <osv@javad.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13Merge git://repo.or.cz/git-guiJunio C Hamano
* git://repo.or.cz/git-gui: git-gui: Automatically spell check commit messages as the user types git-gui: support Git Gui.app under OS X 10.5 git-gui: Update German translation. git-gui: (i18n) Fix a bunch of still untranslated strings.
2008-02-13Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano
* git://git.kernel.org/pub/scm/gitk/gitk: [PATCH] gitk: learn --show-all output [PATCH] gitk: properly deal with tag names containing / (slash) [PATCH] gitk: Add checkbutton to ignore space changes [PATCH] gitk: Fix "Key bindings" message
2008-02-13[PATCH] gitk: learn --show-all outputLinus Torvalds
It's really not very easy to visualize the commit walker, because - on purpose - it obvously doesn't show the uninteresting commits! We will soon add a "--show-all" flag to the revision walker, which will make it show uninteresting commits too, and they'll have a '^' in front of them. This is to update 'gitk' to show those negative commits in gray to futureproof it. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2008-02-13Revert "pack-objects: only throw away data during memory pressure"Junio C Hamano
This reverts commit 9c2174350cc0ae0f6bad126e15fe1f9f044117ab. Nico analyzed and found out that this does not really help, and I agree with it. By the time this gets into action and data is actively thrown away, performance simply goes down the drain due to the data constantly being reloaded over and over and over and over and over and over again, to the point of virtually making no relative progress at all. The previous behavior of enforcing the memory limit by dynamically shrinking the window size at least had the effect of allowing some kind of progress, even if the end result wouldn't be optimal. And that's the whole point behind this memory limiting feature: allowing some progress to be made when resources are too limited to let the repack go unbounded.
2008-02-13Fix 'git cvsexportcommit -w $cvsdir ...' when used with relative $GIT_DIRJohan Herland
When using the '-w $cvsdir' option to cvsexportcommit, it will chdir into $cvsdir before executing several other git commands. If $GIT_DIR is set to a relative path (e.g. '.'), the git commands executed by cvsexportcommit will naturally fail. Therefore, ensure that $GIT_DIR is absolute before the chdir to $cvsdir. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-13Add testcase for 'git cvsexportcommit -w $cvsdir ...' with relative $GIT_DIRJohan Herland
The testcase verifies that 'git cvsexportcommit' functions correctly when the '-w' option is used, and GIT_DIR is set to a relative path (e.g. '.'). Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-12git-gui: Automatically spell check commit messages as the user typesShawn O. Pearce
Many user friendly tools like word processors, email editors and web browsers allow users to spell check the message they are writing as they type it, making it easy to identify a common misspelling of a word and correct it on the fly. We now open a bi-directional pipe to Aspell and feed the message text the user is editing off to the program about once every 300 milliseconds. This is frequent enough that the user sees the results almost immediately, but is not so frequent as to cause significant additional load on the system. If the user has modified the message text during the last 300 milliseconds we delay until the next period, ensuring that we avoid flooding the Aspell process with a lot of text while the user is actively typing their message. We wait to send the current message buffer to Aspell until the user is at a word boundary, thus ensuring that we are not likely to ask for misspelled word detection on a word that the user is actively typing, as most words are misspelled when only partially typed, even if the user has thus far typed it correctly. Misspelled words are highlighted in red and are given an underline, causing the word to stand out from the others in the buffer. This is a very common user interface idiom for displaying misspelled words, but differs from one platform to the next in slight variations. For example the Mac OS X system prefers using a dashed red underline, leaving the word in the original text color. Unfortunately the control that Tk gives us over text display is not powerful enough to handle such formatting so we have to work with the least common denominator. The top suggestions for a misspelling are saved in an array and offered to the user when they right-click (or on the Mac ctrl-click) a misspelled word. Selecting an entry from this menu will replace the misspelling with the correction shown. Replacement is integrated with the undo/redo stack so undoing a replacement will restore the misspelled original text. If Aspell could not be started during git-gui launch we silently eat the error and run without spell checking support. This way users who do not have Aspell in their $PATH can continue to use git-gui, although they will not get the advanced spelling functionality. If Aspell started successfully the version line and language are shown in git-gui's about box, below the Tcl/Tk versions. This way the user can verify the Aspell function has been activated. If Aspell crashes while we are running we inform the user with an error dialog and then disable Aspell entirely for the rest of this git-gui session. This prevents us from fork-bombing the system with Aspell instances that always crash when presented with the current message text, should there be a bug in either Aspell or in git-gui's output to it. We escape all input lines with ^, as recommended by the Aspell manual page, as this allows Aspell to properly ignore any input line that is otherwise looking like a command (e.g. ! to enable terse output). By using this escape however we need to correct all word offsets by -1 as Aspell is apparently considering the ^ escape to be part of the line's character count, but our Tk text widget obviously does not. Available dictionaries are offered in the Options dialog, allowing the user to select the language they want to spellcheck commit messages with for the current repository, as well as the global user setting that all repositories inherit. Special thanks to Adam Flott for suggesting connecting git-gui to Aspell for the purpose of spell checking the commit message, and to Wincent Colaiuta for the idea to wait for a word boundary before passing the message over for checking. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-12Merge branch 'maint'Shawn O. Pearce
* maint: git-gui: support Git Gui.app under OS X 10.5
2008-02-12git-gui: support Git Gui.app under OS X 10.5Jay Soffian
The Tk Framework moved its location in 10.5 compared to 10.4 Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Tested-by: Seth Falcon <seth@userprimary.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-12.mailmap: adjust to a recent patch application glitch.Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-12Update the main documentation (stale notes section)Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-12Add compat/fopen.c which returns NULL on attempt to open directoryBrandon Casey
Some systems do not fail as expected when fread et al. are called on a directory stream. Replace fopen on such systems which will fail when the supplied path is a directory. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-12Merge branch 'db/no-separate-ls-remote-connection' (early part)Junio C Hamano
* 'db/no-separate-ls-remote-connection' (early part): Fix "git clone" for git:// protocol Reduce the number of connects when fetching
2008-02-12Merge branch 'mw/send-email'Junio C Hamano
* mw/send-email: git-send-email: Better handling of EOF git-send-email: SIG{TERM,INT} handlers git-send-email: ssh/login style password requests
2008-02-12Merge branch 'db/send-email-omit-cc'Junio C Hamano
* db/send-email-omit-cc: git-send-email: Generalize auto-cc recipient mechanism.
2008-02-12Merge branch 'jc/error-message-in-cherry-pick'Junio C Hamano
* jc/error-message-in-cherry-pick: Make error messages from cherry-pick/revert more sensible