aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* rebase -i: remove unnecessary state rebase-rootMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | Before calling 'git cherry-pick', interactive rebase currently checks if we are rebasing from root (if --root was passed). If we are, the '--ff' flag to 'git cherry-pick' is omitted. However, according to the documentation for 'git cherry-pick --ff', "If the current HEAD is the same as the parent of the cherry-picked commit, then a fast forward to this commit will be performed.". This should never be the case when rebasing from root, so it should not matter whether --ff is passed, so simplify the code by removing the condition. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -i: don't read unused variable preserve_mergesMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | Since 8e4a91b (rebase -i: remember the settings of -v, -s and -p when interrupted, 2007-07-08), the variable preserve_merges (then called PRESERVE_MERGES) was detected from the state saved in $GIT_DIR/rebase-merge in order to be used when the rebase resumed, but its value was never actually used. The variable's value was only used when the rebase was initated. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-rebase--am: remove unnecessary --3way optionMartin von Zweigbergk2011-02-10
| | | | | | | | | Since 22db240 (git-am: propagate --3way options as well, 2008-12-04), the --3way has been propageted across failure, so it is since pointless to pass it to git-am when resuming. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -m: don't print exit code 2 when merge failsMartin von Zweigbergk2011-02-10
| | | | | | | | | When the merge strategy fails, a message suggesting the user to try another strategy is displayed. Remove the "$rv" (which is always equal to "2" in this case) from that message. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -m: remember allow_rerere_autoupdate optionMartin von Zweigbergk2011-02-10
| | | | | | | | | | If '--[no-]allow_rerere_autoupdate' is passed when 'git rebase -m' is called and a merge conflict occurs, the flag will be forgotten for the rest of the rebase process. Make rebase remember it by saving the value. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: remember strategy and strategy optionsMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | When a rebase is resumed, interactive rebase remembers any merge strategy passed when the rebase was initated. Make non-interactive rebase remember any merge strategy as well. Also make non-interactive rebase remember any merge strategy options. To be able to resume a rebase that was initiated with an older version of git (older than this commit), make sure not to expect the saved option files to exist. Test case idea taken from Junio's 71fc224 (t3402: test "rebase -s<strategy> -X<opt>", 2010-11-11). Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: remember verbose optionMartin von Zweigbergk2011-02-10
| | | | | | | | | Currently, only interactive rebase remembers the value of the '-v' flag from the initial invocation. Make non-interactive rebase also remember it. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: extract code for writing basic stateMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | | | Extract the code for writing the state to rebase-apply/ or rebase-merge/ when a rebase is initiated. This will make it easier to later make both interactive and non-interactive rebase remember the options used. Note that non-interactive rebase stores the sha1 of the original head in a file called orig-head, while interactive rebase stores it in a file called head. Change this by writing to orig-head in both cases. When reading, try to read from orig-head. If that fails, read from head instead. This protects users who upgraded git while they had an ongoing interactive rebase, while still making it possible to remove the code that reads from head at some point in the future. Helped-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: factor out sub command handlingMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | Factor out the common parts of the handling of the sub commands '--continue', '--skip' and '--abort'. The '--abort' handling can handled completely in git-rebase.sh. After this refactoring, the calls to git-rebase--am.sh, git-rebase--merge.sh and git-rebase--interactive.sh will be better aligned. There will only be one call to interactive rebase that will shortcut the very last part of git-rebase.sh. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: make -v a tiny bit more verboseMartin von Zweigbergk2011-02-10
| | | | | | | | | To make it possible to later remove the handling of --abort from git-rebase--interactive.sh, align the implementation in git-rebase.sh with the former by making it a bit more verbose. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -i: align variable namesMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | Rename variables HEAD and OLDHEAD to orig_head and HEADNAME to head_name, which are the names used in git-rebase.sh. This prepares for factoring out of the code that persists these variables during the entire rebase process. Using the same variable names to mean the same thing in both files also makes the code easier to read. While at it, also remove the DOTEST variable and use the state_dir variable that was inherited from git-rebase.sh instead. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: show consistent conflict resolution hintMartin von Zweigbergk2011-02-10
| | | | | | | | | When rebase stops due to conflict, interactive rebase currently displays a different hint to the user than non-interactive rebase does. Use the same message for both types of rebase. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: extract am code to new source fileMartin von Zweigbergk2011-02-10
| | | | | | | | Extract the code for am-based rebase to git-rebase--am.sh. Suggested-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: extract merge code to new source fileMartin von Zweigbergk2011-02-10
| | | | | | | | Extract the code for merge-based rebase to git-rebase--merge.sh. Suggested-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: remove $branch as synonym for $orig_headMartin von Zweigbergk2011-02-10
| | | | | | | | | The variables $branch and $orig_head were used as synonyms. To avoid confusion, remove $branch. The name 'orig_head' seems more suitable, since that is the name used when the variable is persisted. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -i: support --statMartin von Zweigbergk2011-02-10
| | | | | | | | | | | Move up the code that displays the diffstat if '--stat' is passed, so that it will be executed before calling git-rebase--interactive.sh. A side effect is that the diffstat is now displayed before "First, rewinding head to replay your work on top of it...". Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: factor out call to pre-rebase hookMartin von Zweigbergk2011-02-10
| | | | | | | | | Remove the call to the pre-rebase hook from git-rebase--interactive.sh and rely on the call in git-rebase.sh. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: factor out clean work tree checkMartin von Zweigbergk2011-02-10
| | | | | | | | Remove the check for clean work tree from git-rebase--interactive.sh and rely on the check in git-rebase.sh. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: factor out reference parsingMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | Remove the parsing and validation of references (onto, upstream, branch) from git-rebase--interactive.sh and rely on the information exported from git-rebase.sh. By using the parsing of the --onto parameter in git-rebase.sh, this improves the error message when the parameter is invalid. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: reorder validation stepsMartin von Zweigbergk2011-02-10
| | | | | | | | | | | Reorder validation steps in preparation for the validation to be factored out from git-rebase--interactive.sh into git-rebase.sh. The main functional difference is that the pre-rebase hook will no longer be run if the work tree is dirty. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase -i: remove now unnecessary directory checksMartin von Zweigbergk2011-02-10
| | | | | | | | Remove directory checks from git-rebase--interactive.sh that are done in git-rebase.sh. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: factor out command line option processingMartin von Zweigbergk2011-02-10
| | | | | | | | | | Factor out the command line processing in git-rebase--interactive.sh to git-rebase.sh. Store the options in variables in git-rebase.sh and then source git-rebase--interactive.sh. Suggested-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: align variable contentMartin von Zweigbergk2011-02-10
| | | | | | | | | | Make sure to interpret variables with the same name in the same way in git-rebase.sh and git-rebase--interactive.sh. This will make it easier to factor out code from git-rebase.sh to git-rebase--interactive and export the variables. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: align variable namesMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | | | | | git-rebase--interactive.sh will soon be sourced from git-rebase.sh. Align the names of variables used in these scripts to prepare for that. Some names in git-rebase--interactive.sh, such as "author_script" and "amend", are currently used in their upper case form to refer to a file and in their lower case form to refer to something else. In these cases, change the name of the existing lower case variable and downcase the name of the variable that refers to the file. Currently, git-rebase.sh uses mostly lower case variable names, while git-rebase--interactive.sh uses mostly upper case variable names. For consistency, downcase all variables, not just the ones that will be shared between the two script files. Helped-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: stricter check of standalone sub commandMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | The sub commands '--continue', '--skip' or '--abort' may only be used standalone according to the documentation. Other options following the sub command are currently not accepted, but options preceeding them are. For example, 'git rebase --continue -v' is not accepted, while 'git rebase -v --continue' is. Tighten up the check and allow no other options when one of these sub commands are used. Only check that it is standalone for non-interactive rebase for now. Once the command line processing for interactive rebase has been replaced by the command line processing in git-rebase.sh, this check will also apply to interactive rebase. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: act on command line outside parsing loopMartin von Zweigbergk2011-02-10
| | | | | | | | | | | To later be able to use the command line processing in git-rebase.sh for both interactive and non-interactive rebases, move anything that is specific to non-interactive rebase outside of the parsing loop. Keep only parsing and validation of command line options in the loop. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: improve detection of rebase in progressMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | | | | | | Detect early on if a rebase is in progress and what type of rebase it is (interactive, merge-based or am-based). This prepares for further refactoring where am-based rebase will be dispatched to git-rebase--am.sh and merge-based rebase will be dispatched to git-rebase--merge.sh. The idea is to use the same variables whether the type of rebase was detected from rebase-apply/ or rebase-merge/ directories or from the command line options. This will make the code more readable and will later also make it easier to dispatch to the type-specific scripts. Also show a consistent error message independent of the type of rebase that was in progress and remove the obsolete wording about being in the middle of a 'patch application', since that (an existing "$GIT_DIR"/rebase-apply/applying) aborts 'git rebase' at an earlier stage. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: remove unused rebase state 'prev_head'Martin von Zweigbergk2011-02-10
| | | | | | | | | The state stored in $GIT_DIR/rebase-merge/prev_head was introduced in 58634db (rebase: Allow merge strategies to be used when rebasing, 2006-06-21), but it was never used and should therefore be removed. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: read state outside loopMartin von Zweigbergk2011-02-10
| | | | | | | | | | | The 'onto_name' state used in 'git rebase --merge' is currently read once for each commit that need to be applied. It doesn't change between each iteration, however, so it should be moved out of the loop. This also makes the code more readable. Also remove the unused variable 'end'. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: refactor reading of stateMartin von Zweigbergk2011-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code reading the state saved in $merge_dir or $rebase_dir is currently spread out in many places, making it harder to read and to introduce additional state. Extract this code into one method that reads the state. Only extract the code associated with the state that is written when the rebase is initiated. Leave the state that changes for each commmit, at least for now. Currently, when resuming a merge-based rebase using --continue or --skip, move_to_original_branch (via finish_rb_merge) will be called without head_name and orig_head set. These variables are then lazily read in move_to_original_branch if head_name is not set (together with onto, which is unnecessarily read again). Change this by always eagerly reading the state, for both am-based and merge-based rebase, in the --continue and --skip cases. Note that this does not change the behavior for am-based rebase, which read the state eagerly even before this commit. Reading the state eagerly means that part of the state will sometimes be read unnecessarily. One example is when the rebase is continued, but stops again at another merge conflict. Another example is when the rebase is aborted. However, since both of these cases involve user interaction, the delay is hopefully not noticeable. The call_merge/continue_merge loop is not affected. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rebase: clearer names for directory variablesMartin von Zweigbergk2011-02-10
| | | | | | | | | Instead of using the old variable name 'dotest' for "$GIT_DIR"/rebase-merge and no variable for "$GIT_DIR"/rebase-apply, introduce two variables 'merge_dir' and 'apply_dir' for these paths. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'tr/merge-unborn-clobber'Junio C Hamano2011-02-09
|\ | | | | | | | | | | | | | | * tr/merge-unborn-clobber: Exhibit merge bug that clobbers index&WT Conflicts: t/t7607-merge-overwrite.sh
| * Exhibit merge bug that clobbers index&WTThomas Rast2010-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running git-merge on an unborn branch is supposed to do an index-level merge with the other side, and then update the branch name there. In the common case where the index was empty at the start, this makes 'git pull otherrepo branch' a convenient way to populate the history after 'git init'. However, if the index was *not* empty, git-merge silently discards *both index and worktree* copies of all files that were tracked, leading to data loss. Exhibit this bug. Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jc/unpack-trees'Junio C Hamano2011-02-09
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * jc/unpack-trees: unpack_trees(): skip trees that are the same in all input unpack-trees.c: cosmetic fix Conflicts: unpack-trees.c
| * | unpack_trees(): skip trees that are the same in all inputJunio C Hamano2011-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unpack_trees() merges two trees (the current HEAD and the destination commit) when switching to another branch, checking and updating the index entry where the destination differs from the current HEAD. It merges three trees (the common ancestor, the current HEAD and the other commit) when performing a three-way merge, checking and updating the index entry when the merge result differs from the current HEAD. It does so by walking the input trees in parallel all the way down to the leaves. One common special case is a directory is identical across the trees involved in the merge. In such a case, we do not have to descend into the directory at all---we know that the end result is to keep the entries in the current index. This optimization cannot be applied in a few special cases in unpack_trees(), though. We need to descend into the directory and update the index entries from the target tree in the following cases: - When resetting (e.g. "git reset --hard"); and - When checking out a tree for the first time into an empty working tree (e.g. "git read-tree -m -u HEAD HEAD" with missing .git/index). Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | unpack-trees.c: cosmetic fixJunio C Hamano2010-12-22
| | | | | | | | | | | | | | | | | | Make the parts a bit more readable before touching them. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/fsck-fixes'Junio C Hamano2011-02-09
|\ \ \ | | | | | | | | | | | | | | | | | | | | * jc/fsck-fixes: fsck: do not give up too early in fsck_dir() fsck: drop unused parameter from traverse_one_object()
| * | | fsck: do not give up too early in fsck_dir()Junio C Hamano2011-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there is a random garbage file whose name happens to be 38-byte long in a .git/objects/??/ directory, the loop terminated prematurely without marking all the other files that it hasn't checked in the readdir() loop. Treat such a file just like any other garbage file, and do not break out of the readdir() loop. While at it, replace repeated sprintf() calls to a single one outside the loop. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | fsck: drop unused parameter from traverse_one_object()Junio C Hamano2011-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add comments to seemingly unsafe pointer dereferences, that are all safe. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'tr/diff-words-test'Junio C Hamano2011-02-09
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/diff-words-test: t4034 (diff --word-diff): add a minimum Perl drier test vector t4034 (diff --word-diff): style suggestions userdiff: simplify word-diff safeguard t4034: bulk verify builtin word regex sanity
| * | | | t4034 (diff --word-diff): add a minimum Perl drier test vectorJunio C Hamano2011-01-18
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | t4034 (diff --word-diff): style suggestionsJonathan Nieder2011-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rearrange code to be easier to browse: - first data - then functions - then test assertions Mark up inline test vectors as cat >vector <<-\EOF data data EOF for visual scannability. Use words like "set up" for tests that set up for other tests, to make it obvious which tests are safe to skip. Use repeated function calls instead of a loop for the language-specific tests, so the invocations can be easily tweaked individually (for example if one starts to fail). This means if you add a new subdirectory to t4034/, it will not be automatically used. I think that's worth it for the added explicitness. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | userdiff: simplify word-diff safeguardJonathan Nieder2011-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git's diff-words support has a detail that can be a little dangerous: any text not matched by a given language's tokenization pattern is treated as whitespace and changes in such text would go unnoticed. Therefore each of the built-in regexes allows a special token type consisting of a single non-whitespace character [^[:space:]]. To make sure UTF-8 sequences remain human readable, the builtin regexes also have a special token type for runs of bytes with the high bit set. In English, non-ASCII characters are usually isolated so this is analogous to the [^[:space:]] pattern, except it matches a single _multibyte_ character despite use of the C locale. Unfortunately it is easy to make typos or forget entirely to include these catch-all token types when adding support for new languages (see v1.7.3.5~16, userdiff: fix typo in ruby and python word regexes, 2010-12-18). Avoid this by including them automatically within the PATTERNS and IPATTERN macros. While at it, change the UTF-8 sequence token type to match exactly one non-ASCII multi-byte character, rather than an arbitrary run of them. Suggested-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | t4034: bulk verify builtin word regex sanityThomas Rast2011-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The builtin word regexes should be tested with some simple examples against simple issues. Do this in bulk. Mainly due to a lack of language knowledge and inspiration, most of the test cases (cpp, csharp, java, objc, pascal, php, python, ruby) are directly based off a C operator precedence table to verify that all operators are split correctly. This means that they are probably incomplete or inaccurate except for 'cpp' itself. Still, they are good enough to already have uncovered a typo in the python and ruby patterns. 'fortran' is based on my anecdotal knowledge of the DO10I parsing rules, and thus probably useless. The rest (bibtex, html, tex) are an ad-hoc test of what I consider important splits in those languages. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'rr/fi-import-marks-if-exists'Junio C Hamano2011-02-09
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * rr/fi-import-marks-if-exists: fast-import: Introduce --import-marks-if-exists
| * | | | | fast-import: Introduce --import-marks-if-existsRamkumar Ramachandra2011-01-18
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a frontend uses a marks file to ensure its state persists between runs, it may represent "clean slate" when bootstrapping with "no marks yet". In such a case, feeding the last state with --import-marks and saving the state after the current run with --export-marks would be a natural thing to do. The --import-marks option however errors out when the specified marks file doesn't exist; this makes bootstrapping a bit difficult. The location of the marks file becomes backend-dependent when --relative-marks is in effect, and the frontend cannot check for the existence of the file in such a case. The --import-marks-if-exists option does the same thing as --import-marks but does not flag an error if the named file does not exist yet to help these frontends. Helped-by: Junio C Hamano <gitster@pobox.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'jn/unpack-lstat-failure-report'Junio C Hamano2011-02-09
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jn/unpack-lstat-failure-report: unpack-trees: handle lstat failure for existing file unpack-trees: handle lstat failure for existing directory
| * | | | | unpack-trees: handle lstat failure for existing fileJonathan Nieder2011-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When check_leading_path notices a file in the way of a new entry to be checked out, verify_absent uses (1) the mode to determine whether it is a directory (2) the rest of the stat information to check if this is actually an old entry, disguised by a change in filename (e.g., README -> Readme) that is significant to git but insignificant to the underlying filesystem. If lstat fails, these checks are performed with an uninitialied stat structure, producing essentially random results. Better to just error out when lstat fails. The easiest way to reproduce this is to remove a file after the check_leading_path call and before the lstat in verify_absent. An lstat failure other than ENOENT in check_leading_path would also trigger the same code path. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | unpack-trees: handle lstat failure for existing directoryJonathan Nieder2011-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When check_leading_path notices no file in the way of the new entry to be checked out, verify_absent checks whether there is a directory there or nothing at all. If that lstat call fails (for example due to ENOMEM), it assumes ENOENT, meaning a directory with untracked files would be clobbered in that case. Check errno after calling lstat, and for conditions other than ENOENT, just error out. This is a theoretical race condition. lstat has to succeed moments before it fails for there to be trouble. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'ef/alias-via-run-command'Junio C Hamano2011-02-09
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ef/alias-via-run-command: alias: use run_command api to execute aliases