summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* unpack_trees(): protect the handcrafted in-core index from read_cache()Junio C Hamano2008-08-233-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-p4: Fix one-liner in p4_write_pipe function.Tor Arvid Lund2008-08-221-1/+1
| | | | | | | | 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>
* Completion: add missing '=' for 'diff --diff-filter'Eric Raible2008-08-221-1/+1
| | | | | | 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>
* Fix 'git help help'Miklos Vajna2008-08-211-1/+2
| | | | | | | | | | 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>
* compat/snprintf.c: handle snprintf's that always return the # chars transmittedBrandon Casey2008-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* git-svn: fix dcommit to urls with embedded usernamesEric Wong2008-08-201-3/+5
| | | | | | | | | | | | | | | | 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>
* revision.h: make show_early_output an extern which is defined in revision.cBrandon Casey2008-08-201-1/+1
| | | | | | | | | 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>
* Update draft release notes for 1.6.0.1Junio C Hamano2008-08-201-2/+18
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add hints to revert documentation about other ways to undo changesTarmigan Casebolt2008-08-201-0/+9
| | | | | | | | | | | | | | 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>
* Install templates with the user and group of the installing personalityJohannes Sixt2008-08-201-1/+1
| | | | | | | | | | 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>
* "git-merge": allow fast-forwarding in a stat-dirty treeJunio C Hamano2008-08-202-1/+11
| | | | | | | 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>
* completion: find out supported merge strategies correctlyJunio C Hamano2008-08-201-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
* decorate: allow const objects to be decoratedJeff King2008-08-202-8/+9
| | | | | | | | | | 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>
* for-each-ref: cope with tags with incomplete linesJunio C Hamano2008-08-202-1/+13
| | | | | | | 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>
* diff --check: do not get confused by new blank lines in the middleJunio C Hamano2008-08-202-0/+12
| | | | | | | | | | | 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>
* remote.c: remove useless if-before-free testJim Meyering2008-08-191-2/+1
| | | | | | | | 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>
* mailinfo: avoid violating strbuf assertionJeff King2008-08-194-1/+25
| | | | | | | | | | | | | | | | | | | | | | | 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>
* git format-patch: avoid underrun when format.headers is empty or all NLsJim Meyering2008-08-191-1/+1
| | | | | | | | | * 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>
* t1002-read-tree-m-u-2way.sh: use 'git diff -U0' rather than 'diff -U0'Brandon Casey2008-08-181-4/+6
| | | | | | | | | 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>
* adapt git-cvsserver manpage to dash-free syntaxRobert Schiele2008-08-181-4/+4
| | | | | Signed-off-by: Robert Schiele <rschiele@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* mailinfo: re-fix MIME multipart boundary parsingDon Zickus2008-08-182-3/+4
| | | | | | | | | | | | | | | | | | 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>
* Start 1.6.0.X maintenance seriesJunio C Hamano2008-08-172-1/+16
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* GIT 1.6.0v1.6.0Junio C Hamano2008-08-173-13/+17
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge git-gui 0.11.0Junio C Hamano2008-08-171-1/+1
|\
| * git-gui 0.11gitgui-0.11.0Shawn O. Pearce2008-08-101-1/+1
| | | | | | | | Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge branch 'ak/p4'Junio C Hamano2008-08-172-28/+124
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | Utilise our new p4_read_pipe and p4_write_pipe wrappersAnand Kumria2008-08-141-3/+3
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Add p4 read_pipe and write_pipe wrappersAnand Kumria2008-08-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Put in the two other configuration elements found in the sourceAnand Kumria2008-08-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | I am not entirely clear what these parameters do but felt it useful to call them out in the documentation. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Put some documentation in about the parameters that have been addedAnand Kumria2008-08-111-0/+32
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Move git-p4.syncFromOrigin into a configuration parameters sectionAnand Kumria2008-08-111-12/+16
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Consistently use 'git-p4' for the configuration entriesAnand Kumria2008-08-111-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | If the user has configured various parameters, use them.Anand Kumria2008-08-111-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Some repositories require authentication and access to certain hosts. Allow git-p4 to pull this information from the configuration Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Switch to using 'p4_build_cmd'Anand Kumria2008-08-111-7/+3
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | If we are in verbose mode, output what we are about to run (or return)Anand Kumria2008-08-111-0/+2
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Add a single command that will be used to construct the 'p4' commandAnand Kumria2008-08-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than having three locations where the 'p4' command is built up, refactor this into the one place. This will, eventually, allow us to have one place where we modify the evironment or pass extra command-line options to the 'p4' binary. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Utilise the new 'p4_system' function.Anand Kumria2008-08-111-9/+9
| | | | | | | | | | | | | | | Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Have a command that specifically invokes 'p4' (via system)Anand Kumria2008-08-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Similiar to our 'p4_read_pipe_lines' command, we can isolate specific changes to the invocation method in the one location with this change. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Utilise the new 'p4_read_pipe_lines' commandAnand Kumria2008-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Now that we have the new command, we can utilise it and then eventually, isolate any changes required to the one place. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | Create a specific version of the read_pipe_lines command for p4 invocationsAnand Kumria2008-08-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This will make it easier to isolate changes to how 'p4' is invoked (whether with parameters or not, etc.). Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-p4: chdir now properly sets PWD environment variable in msysGitRobert Blum2008-08-161-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Improve error output of git-rebaseStephan Beyer2008-08-161-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
* | | t9300: replace '!' with test_must_failMiklos Vajna2008-08-161-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano2008-08-161-6/+8
|\ \ \ | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/gitk/gitk: gitk: Allow safely calling nukefile from a run queue handler
| * | | gitk: Allow safely calling nukefile from a run queue handlerAlexander Gavrilov2008-08-111-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally dorunq assumed that the queue entry remained first in the queue after the script eval, and blindly removed it. However, if the handler calls nukefile, it may not be the case anymore, and a random queue entry gets dropped instead. This makes dorunq remove the entry before calling the script, and adds a global variable to allow other functions to determine if they are called from within a dorunq handler. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
* | | | Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep2008-08-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Documentation: document the pager.* configuration settingMiklos Vajna2008-08-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | git-stash: improve synopsis in help and manual pageStephan Beyer2008-08-162-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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>
* | | | Makefile: building git in cygwin 1.7.0Eric Blake2008-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | git-am: ignore --binary optionStephan Beyer2008-08-163-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>