summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2008-08-24GIT 1.6.0.1v1.6.0.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Merge branch 'ag/maint-combine-diff-fix' into maintJunio C Hamano
* ag/maint-combine-diff-fix: Respect core.autocrlf in combined diff
2008-08-24Merge branch 'mv/maint-merge-fix' into maintJunio C Hamano
* mv/maint-merge-fix: merge: fix numerus bugs around "trivial merge" area
2008-08-24Documentation: clarify pager configurationJonathan Nieder
The unwary user may not know how to disable the -FRSX options. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Documentation: clarify pager.<cmd> configurationJonathan Nieder
It was not obvious from the text that pager.<cmd> is a boolean setting. While we're changing the description, make some other improvements: lest we forget and fret, clarify that -p and pager.<cmd> do not kick in when stdout is not a tty; point to related core.pager and GIT_PAGER settings; use renamed --paginate option. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Clean up the git-p4 documentationSimon Hausmann
This patch massages the documentation a bit for improved readability and cleans it up from outdated options/commands. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Respect core.autocrlf in combined diffAlexander Gavrilov
Fix git-diff to make it produce useful 3-way diffs for merge conflicts in repositories with autocrlf enabled. Otherwise it always reports that the whole file was changed, because it uses the contents from the working tree without necessary conversion. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24Makefile: enable SNPRINTF_RETURNS_BOGUS for HP-UXMiklos Vajna
In 81cc66a, customization has been added to Makefile for supporting HP-UX, but git commit is still problematic. This should fix the issue. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Acked-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24merge: fix numerus bugs around "trivial merge" areaJunio C Hamano
The "trivial merge" codepath wants to optimize itself by making an internal call to the read-tree machinery, but it does not read the index before doing so, and the codepath is never exercised. Incidentally, this failure to read the index upfront means that the safety to refuse doing anything when the index is unmerged does not kick in, either. These two problem are fixed by using read_cache_unmerged() that does read the index before checking if it is unmerged at the beginning of cmd_merge(). The primary logic of the merge, however, assumes that the process never reads the index in-core, and the call to write_cache_as_tree() it makes from write_tree_trivial() will always read from the on-disk index that is prepared the strategy back-ends. This assumption is now broken by the above fix. To fix this issue, we now call discard_cache() before calling write_tree_trivial() when it wants to write the on-disk index as a tree. When multiple strategies are tried, their results are evaluated by reading the resulting index and inspecting it. The codepath needs to make a call to read_cache() for each successful strategy, and for that to work, they need to discard_cache() the one read by the previous round. Also the "trivial merge" forgot that the current commit is one of the parents of the resulting commit. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24unpack_trees(): protect the handcrafted in-core index from read_cache()Junio C Hamano
unpack_trees() rebuilds the in-core index from scratch by allocating a new structure and finishing it off by copying the built one to the final index. The resulting in-core index is Ok for most use, but read_cache() does not recognize it as such. The function is meant to be no-op if you already have loaded the index, until you call discard_cache(). This change the way read_cache() detects an already initialized in-core index, by introducing an extra bit, and marks the handcrafted in-core index as initialized, to avoid this problem. A better fix in the longer term would be to change the read_cache() API so that it will always discard and re-read from the on-disk index to avoid confusion. But there are higher level API that have relied on the current semantics, and they and their users all need to get converted, which is outside the scope of 'maint' track. An example of such a higher level API is write_cache_as_tree(), which is used by git-write-tree as well as later Porcelains like git-merge, revert and cherry-pick. In the longer term, we should remove read_cache() from there and add one to cmd_write_tree(); other callers expect that the in-core index they prepared is what gets written as a tree so no other change is necessary for this particular codepath. The original version of this patch marked the index by pointing an otherwise wasted malloc'ed memory with o->result.alloc, but this version uses Linus's idea to use a new "initialized" bit, which is conceptually much cleaner. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-23git-p4: Fix one-liner in p4_write_pipe function.Tor Arvid Lund
The function built a p4 command string via the p4_build_cmd function, but ignored the result. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22Completion: add missing '=' for 'diff --diff-filter'Eric Raible
Signed-off-by: Eric Raible <raible@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22Fix 'git help help'Miklos Vajna
git help foo invokes man git-foo if foo is a git command, otherwise it invokes man gitfoo. 'help' is not a git command, but the manual page is called git-help, so add this special exception. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-21compat/snprintf.c: handle snprintf's that always return the # chars transmittedBrandon Casey
Some platforms provide a horribly broken snprintf. More broken than the platforms that return -1 when there is too little space in the target buffer for the formatted string. Some platforms provide an snprintf which _always_ returns the number of characters transmitted to the buffer, regardless of whether there was enough space or not. IRIX 6.5 is such a platform. IRIX does have a working snprintf(), but it is only provided when _NO_XOPEN5 evaluates to zero, and this only happens if _XOPEN_SOURCE is defined, but definition of _XOPEN_SOURCE prevents inclusion of many other common functions and defines. So it must be avoided. Work around these horribly broken snprintf implementations by detecting an snprintf call which results in the number of transmitted characters exactly equal to the length of our buffer and retrying with a larger buffer just to be safe. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-21git-svn: fix dcommit to urls with embedded usernamesEric Wong
Don't rely on the extracted URL from working_head_info since that has the username removed. Instead use the $gs->full_url method (as before with ba24e74 (git-svn: add ability to specify --commit-url for dcommit, 2008-08-07)) to give us the URL to commit to if --commit-url is not specified. Aditionally, since we clean usernames from URLs, checking the URL after rebase can fail because it doesn't match the URL we used to commit; so unconditionally provide a username-free URL for checking the result of the refetch. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-21revision.h: make show_early_output an extern which is defined in revision.cBrandon Casey
The variable show_early_output is defined in revision.c and should be declared extern in revision.h so that the linker does not complain about multiply defined variables. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20Update draft release notes for 1.6.0.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20Add hints to revert documentation about other ways to undo changesTarmigan Casebolt
Based on its name, people may read the 'git revert' documentation when they want to undo local changes, especially people who have used other SCM's. 'git revert' may not be what they had in mind, but git provides several other ways to undo changes to files. We can help them by pointing them towards the git commands that do what they might want to do. Cc: Daniel Barkalow <barkalow@iabervon.org> Cc: Lea Wiemann <lewiemann@gmail.com> Signed-off-by: Tarmigan Casebolt <tarmigan+git@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20Install templates with the user and group of the installing personalityJohannes Sixt
If 'make install' was run with sufficient privileges, then the installed templates, which are copied using 'tar', would receive the user and group of whoever built git. This instructs 'tar' to ignore the user and group that are recorded in the archive. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20"git-merge": allow fast-forwarding in a stat-dirty treeJunio C Hamano
We used to refresh the index to clear stat-dirtyness before a fast-forward merge. Recent C rewrite forgot to do this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20completion: find out supported merge strategies correctlyJunio C Hamano
"git-merge" is a binary executable these days, and looking for assignment to $all_strategies variable with grep/sed does not work well. When asked for an unknown strategy, pre-1.6.0 and post-1.6.0 "git merge" commands respectively say: $ $HOME/git-snap-v1.5.6.5/bin/git merge -s help available strategies are: recur recursive octopus resolve stupid ours subtree $ $HOME/git-snap-v1.6.0/bin/git merge -s help Could not find merge strategy 'help'. Available strategies are: recursive octopus resolve ours subtree. both on their standard error stream. We can use this to learn what strategies are supported. The sed script is written in such a way that it catches both old and new message styles ("Available" vs "available", and the full stop at the end). It also allows future versions of "git merge" to line-wrap the list of strategies, and add extra comments, like this: $ $HOME/git-snap-v1.6.1/bin/git merge -s help Could not find merge strategy 'help'. Available strategies are: blame recursive octopus resolve ours subtree. Also you have custom strategies: theirs Make sure you spell strategy names correctly. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20decorate: allow const objects to be decoratedJeff King
We don't actually modify the struct object, so there is no reason not to accept const versions (and this allows other callsites, like the next patch, to use the decoration machinery). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20for-each-ref: cope with tags with incomplete linesJunio C Hamano
If you have a tag with a single, incomplete line as its payload, asking git-for-each-ref for its %(body) element accessed a NULL pointer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20diff --check: do not get confused by new blank lines in the middleJunio C Hamano
The code remembered that the last diff output it saw was an empty line, and tried to reset that state whenever it sees a context line, a non-blank new line, or a new hunk. However, this codepath asks the underlying diff engine to feed diff without any context, and the "just saw an empty line" state was not reset if you added a new blank line in the last hunk of your patch, even if it is not the last line of the file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20remote.c: remove useless if-before-free testJim Meyering
We removed a handful of these useless if-before-free tests several months ago. This change removes a new one that snuck back in. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20mailinfo: avoid violating strbuf assertionJeff King
In handle_from, we calculate the end boundary of a section to remove from a strbuf using strcspn like this: el = strcspn(buf, set_of_end_boundaries); strbuf_remove(&sb, start, el + 1); This works fine if "el" is the offset of the boundary character, meaning we remove up to and including that character. But if the end boundary didn't match (that is, we hit the end of the string as the boundary instead) then we want just "el". Asking for "el+1" caught an out-of-bounds assertion in the strbuf library. This manifested itself when we got a 'From' header that had just an email address with nothing else in it (the end of the string was the end of the address, rather than, e.g., a trailing '>' character), causing git-mailinfo to barf. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20git format-patch: avoid underrun when format.headers is empty or all NLsJim Meyering
* builtin-log.c (add_header): Avoid a buffer underrun when format.headers is empty or all newlines. Reproduce with this: git config format.headers '' && git format-patch -1 Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-19t1002-read-tree-m-u-2way.sh: use 'git diff -U0' rather than 'diff -U0'Brandon Casey
Some old platforms have an old diff which doesn't have the -U option. 'git diff' can be used in its place. Adjust the comparison function to strip git's additional header lines to make this possible. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-19adapt git-cvsserver manpage to dash-free syntaxRobert Schiele
Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-19mailinfo: re-fix MIME multipart boundary parsingDon Zickus
Recent changes to is_multipart_boundary() caused git-mailinfo to segfault. The reason was after handling the end of the boundary the code tried to look for another boundary. Because the boundary list was empty, dereferencing the pointer to the top of the boundary caused the program to go boom. The fix is to check to see if the list is empty and if so go on its merry way instead of looking for another boundary. I also fixed a couple of increments and decrements that didn't look correct relating to content_top. The boundary test case was updated to catch future problems like this again. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17Start 1.6.0.X maintenance seriesJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17GIT 1.6.0v1.6.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17Merge git-gui 0.11.0Junio C Hamano
2008-08-17Merge branch 'ak/p4'Junio C Hamano
* ak/p4: Utilise our new p4_read_pipe and p4_write_pipe wrappers Add p4 read_pipe and write_pipe wrappers Put in the two other configuration elements found in the source Put some documentation in about the parameters that have been added Move git-p4.syncFromOrigin into a configuration parameters section Consistently use 'git-p4' for the configuration entries If the user has configured various parameters, use them. Switch to using 'p4_build_cmd' If we are in verbose mode, output what we are about to run (or return) Add a single command that will be used to construct the 'p4' command Utilise the new 'p4_system' function. Have a command that specifically invokes 'p4' (via system) Utilise the new 'p4_read_pipe_lines' command Create a specific version of the read_pipe_lines command for p4 invocations Conflicts: contrib/fast-import/git-p4
2008-08-17git-p4: chdir now properly sets PWD environment variable in msysGitRobert Blum
P4 on Windows expects the PWD environment variable to be set to the current working dir, but os.chdir in python doesn't do so. Signed-off-by: Robert Blum <rob.blum@gmail.com> Acked-by: Simon Hausmann <simon@lst.de> Acked-by: Han-Wen Nienhuys <hanwen@xs4all.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17Improve error output of git-rebaseStephan Beyer
"git rebase" without arguments on initial startup showed: fatal: Needed a single revision invalid upstream This patch makes it show the ordinary usage string. If .git/rebase-merge or .git/rebase-apply/rebasing exists, git-rebase will die with a message saying that a rebase is in progress and the user should try --skip/--abort/--continue. If .git/rebase-apply/applying exists, git-rebase will die with a message saying that git-am is in progress, regardless how many arguments are given. If no arguments are given and .git/rebase-apply/ exists, but neither a rebasing nor applying file is in that directory, git-rebase dies with a message saying that rebase-apply exists and no arguments were given. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17t9300: replace '!' with test_must_failMiklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-17Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano
* git://git.kernel.org/pub/scm/gitk/gitk: gitk: Allow safely calling nukefile from a run queue handler
2008-08-16Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep
This will ensure that the API at large is accessible to nearly all Perl versions, while only the temp file caching API is tied to the File::Temp and File::Spec modules being available. Signed-off-by: Marcus Griep <marcus@griep.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16Documentation: document the pager.* configuration settingMiklos Vajna
It was already documented in RelNotes-1.6.0, but not in the git-config manual page. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16git-stash: improve synopsis in help and manual pageStephan Beyer
"git stash -h" showed some incomplete and ugly usage information. For example, the useful "--keep-index" option for "save" or the "--index" option for "apply" were not shown. Also in the documentation synopsis they were not shown, so that there is no incentive to scroll down and even see that such options exist. This patch improves the git-stash synopsis in the documentation by mentioning that further options to the stash commands and then copies this synopsis to the usage information string of git-stash.sh. For the latter, the dashless git command string has to be inserted on the second and the following usage lines. The code of this is taken from git-sh-setup so that all lines will show the command string. Note that the "create" command is not advertised at all now, because it was not mentioned in git-stash.txt. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16Makefile: building git in cygwin 1.7.0Eric Blake
On platforms with $X, make removes any leftover scripts 'a' from earlier builds if a new binary 'a.exe' is now built. However, on cygwin 1.7.0, 'git' and 'git.exe' now consistently name the same file. Test for file equality before attempting a remove, in order to avoid nuking just-built binaries. Signed-off-by: Eric Blake <ebb9@byu.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16git-am: ignore --binary optionStephan Beyer
The git-apply documentation says that --binary is a historical option. This patch lets git-am ignore --binary and removes advertisements of this option. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16bash-completion: Add non-command git help files to bash-completionMarcus Griep
Git allows access to the gitattributes man page via `git help attributes`, but this is not discoverable via the bash-completion mechanism. This patch adds all current non-command man pages to the completion candidate list. Signed-off-by: Marcus Griep <marcus@griep.us> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-15Fix t3700 on filesystems which do not support question marks in namesAlex Riesen
Use square brackets instead. And the prominent example of the deficiency are, as usual, the filesystems of Microsoft house. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-15Utilise our new p4_read_pipe and p4_write_pipe wrappersAnand Kumria
Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-15Add p4 read_pipe and write_pipe wrappersAnand Kumria
Two additional wrappers to cover 3 places where we utilise p4 in piped form. Found by Tor Arvid Lund. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-15bash completion: Add '--merge' long option for 'git log'Lee Marlow
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>
2008-08-15bash completion: Add completion for 'git mergetool'Lee Marlow
The --tool= long option to "git mergetool" can be completed with: kdiff3 tkdiff meld xxdiff emerge vimdiff gvimdiff ecmerge opendiff 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>
2008-08-15git format-patch documentation: clarify what --cover-letter doesMatt McCutchen
Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>