summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* refs.c: add an err argument to pack_refsrs/ref-transaction-renameRonnie Sahlberg2014-11-073-6/+12
| | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make lock_packed_refs take an err argumentRonnie Sahlberg2014-11-071-12/+13
| | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make add_packed_ref return an error instead of calling dieRonnie Sahlberg2014-11-071-4/+17
| | | | | | | | Change add_packed_ref to return an error instead of calling die(). Update all callers to check the return value of add_packed_ref. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: replace the onerr argument in update_ref with a strbuf errRonnie Sahlberg2014-11-0712-59/+78
| | | | | | | | | | | Get rid of the action_on_err enum and replace the action argument to update_ref with a strbuf *err for error reporting. Update all callers to the new api including two callers in transport*.c which used the literal 0 instead of an enum. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make the *_packed_refs functions staticRonnie Sahlberg2014-11-072-34/+4
| | | | | | | | | We no longer need to expose the lock/add/commit/rollback functions for packed refs anymore so make them static and remove them from the public api. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make repack_without_refs staticRonnie Sahlberg2014-11-072-4/+1
| | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* remote.c: use a transaction for deleting refsRonnie Sahlberg2014-11-071-40/+40
| | | | | | | | Transactions now use packed refs when deleting multiple refs so there is no need to do it manually from remote.c any more. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: write updates to packed refs when a transaction has more than one refRonnie Sahlberg2014-11-073-35/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are updating more than one single ref, i.e. not a commit, then write the updated refs directly to the packed refs file instead of writing them as loose refs. Change clone to use a transaction instead of using the packed refs API. This changes the behavior of clone slightly. Previously clone would always clone all refs into a packed refs file. With this change clone will only clone into packed refs iff there are two or more refs being cloned. If the repository we are cloning from only contains exactly one single ref then clone will now store this as a loose ref. The benefit here is that we no longer need to export a bunch of API functions to clone to access packed refs directly. Clone can now just use a normal transaction and all the packed refs goodness will happen automatically. Update the t5516 test to cope with the fact that clone now only uses packed refs if there are more than one ref being cloned. We still use loose refs for single ref transactions, such as are used by 'git commit' and friends. The reason for this is that if you have very many refs then having to re-write the whole packed refs file for every common operation like commit would have a performance impact. That said, with these changes it should now be fairly straightforward to add support to optionally start using packed refs for ALL updates which could solve existing issues with name clashes in case insensitive filesystems. This change also means that multi-ref updates will now appear as a single atomic change to any external observers instead of a sequence of discreete changes. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: move reflog updates into its own functionRonnie Sahlberg2014-11-071-25/+35
| | | | | | | | | | | | | write_ref_sha1 tries to update the reflog while updating the ref. Move these reflog changes out into its own function so that we can do the same thing if we write a sha1 ref differently, for example by writing a ref to the packed refs file instead. No functional changes intended. We only move some code out into a separate function. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: rollback the lockfile before we die() in repack_without_refsRonnie Sahlberg2014-11-071-1/+3
| | | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: update rename_ref to use a transactionRonnie Sahlberg2014-11-072-132/+43
| | | | | | | | | | Change refs.c to use a single transaction to perform the rename. Change the function to return 1 on failure instead of either -1 or 1. These changes make the rename_ref operation atomic. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: add transaction support for renaming a reflogRonnie Sahlberg2014-11-072-1/+79
| | | | | | | Add a new transaction function transaction_rename_reflog. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: use a stringlist for repack_without_refsRonnie Sahlberg2014-11-033-37/+30
| | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: use packed refs when deleting refs during a transactionRonnie Sahlberg2014-11-032-37/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the deletion of refs during a transaction more atomic. Start by first copying all loose refs we will be deleting to the packed refs file and then commit the packed refs file. Then re-lock the packed refs file to stop anyone else from modifying these refs and keep it locked until we are finished. Since all refs we are about to delete are now safely held in the packed refs file we can proceed to immediately unlink any corresponding loose refs and still be fully rollback-able. The exception is for refs that can not be resolved. Those refs are never added to the packed refs and will just be un-rollback-ably deleted during commit. By deleting all the loose refs at the start of the transaction we make make it possible to both delete one ref and then re-create a different ref in the same transaction even if the two refs would normally conflict. Example: rename m->m/m In that example we want to delete the file 'm' so that we make room so that we can create a directory with the same name in order to lock and write to the ref m/m and its lock-file m/m.lock. If there is a failure during the commit phase we can rollback without losing any refs since we have so far only deleted loose refs that that are guaranteed to also have a corresponding entry in the packed refs file. Once we have finished all updates for refs and their reflogs we can repack the packed refs file and remove the to-be-deleted refs from the packed refs, at which point all the deleted refs will disappear in one atomic rename operation. This also means that for an outside observer, deletion of multiple refs in a single transaction will look atomic instead of one ref being deleted at a time. In order to do all this we need to change the semantics for the repack_without_refs function so that we can lock the packed refs file, do other stuff, and later be able to call repack_without_refs with the lock already taken. This means we need some additional changes in remote.c to reflect the changes to the repack_without_refs semantics. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: return error instead of dying when locking fails during transactionRonnie Sahlberg2014-11-031-2/+8
| | | | | | | | | | | Change lock_ref_sha1_basic to return an error instead of dying when we fail to lock a file during a transaction. This function is only called from transaction_commit() and it knows how to handle these failures. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: allow passing raw git_committer_info as email to _update_reflogRonnie Sahlberg2014-11-033-17/+48
| | | | | | | | | | | | | | | | | | | | | | In many places in the code we do not have access to the individual fields in the committer data. Instead we might only have access to prebaked data such as what is returned by git_committer_info() containing a string that consists of email, timestamp, zone etc. This makes it inconvenient to use transaction_update_reflog since it means you would have to first parse git_committer_info before you can call update_reflog. Add a new flag REFLOG_COMMITTER_INFO_IS_VALID to _update_reflog to tell it that we pass in a fully prebaked committer info string that can be used as is. At the same time, also go over and change all references from email to id where the code actually refers to a committer id and not just an email address. I.e. where the string is : NAME <EMAIL> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: allow deleting refs with a broken sha1rs/ref-transaction-reflogRonnie Sahlberg2014-11-035-4/+28
| | | | | | | | | | | | | | | | | | | | | Add back support to make it possible to delete refs that have a broken sha1. Add new internal flags REF_ALLOW_BROKEN and RESOLVE_REF_ALLOW_BAD_SHA1 to pass intent from branch.c that we are willing to allow resolve_ref_unsafe and lock_ref_sha1_basic to allow broken refs. Since these refs can not actually be resolved to a sha1, they instead resolve to null_sha1 when these flags are used. For example, the ref: echo "Broken ref" > .git/refs/heads/foo-broken-1 can now be deleted using git branch -d foo-broken-1 Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: remove lock_any_ref_for_updateRonnie Sahlberg2014-11-032-15/+1
| | | | | | | | No one is using this function so we can delete it. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make unlock_ref/close_ref/commit_ref staticRonnie Sahlberg2014-11-032-21/+12
| | | | | | | | | unlock|close|commit_ref can be made static since there are no more external callers. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: rename log_ref_setup to create_reflogRonnie Sahlberg2014-11-033-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | log_ref_setup is used to do several semi-related things : * sometimes it will create a new reflog including missing parent directories and cleaning up any conflicting stale directories in the path. * fill in a filename buffer for the full path to the reflog. * unconditionally re-adjust the permissions for the file. This function is only called from two places: checkout.c where it is always used to create a reflog and refs.c:log_ref_write where it sometimes are used to create a reflog and sometimes just used to fill in the filename. Rename log_ref_setup to create_reflog and change it to only take the refname as argument to make its signature similar to delete_reflog and reflog_exists. Change create_reflog to ignore log_all_ref_updates and "unconditionally" create the reflog when called. Since checkout.c always wants to create a reflog we can call create_reflog directly and avoid the temp-and-log_all_ref_update dance. In log_ref_write, only call create_reflog iff we want to create a reflog and if the reflog does not yet exist. This means that for the common case where the log already exists we now only need to perform a single lstat() instead of a open(O_CREAT)+lstat()+close(). Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* reflog.c: use a reflog transaction when writing during expireRonnie Sahlberg2014-11-033-51/+40
| | | | | | | | Use a transaction for all updates during expire_reflog. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: allow multiple reflog updates during a single transactionRonnie Sahlberg2014-11-031-9/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow to make multiple reflog updates to the same ref during a transaction. This means we only need to lock the reflog once, during the first update that touches the reflog, and that all further updates can just write the reflog entry since the reflog is already locked. This allows us to write code such as: t = transaction_begin() transaction_reflog_update(t, "foo", REFLOG_TRUNCATE, NULL); loop-over-something... transaction_reflog_update(t, "foo", 0, <message>); transaction_commit(t) where we first truncate the reflog and then build the new content one line at a time. While this technically looks like O(n2) behavior it not that bad. We only do this loop for transactions that cover a single ref during reflog expire. This means that the linear search inside transaction_update_reflog() will find the match on the very first entry thus making it O(1) and not O(n) or our usecases. Thus the whole expire becomes O(n) instead of O(n2). If in the future we start doing this for many refs in one single transaction we might want to optimize this. But there is no need to complexify the code and optimize for future usecases that might never materialize at this stage. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: only write reflog update if msg is non-NULLRonnie Sahlberg2014-11-032-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When performing a reflog transaction update, only write to the reflog iff msg is non-NULL. This can then be combined with REFLOG_TRUNCATE to perform an update that only truncates but does not write. This change only affects whether or not a reflog entry should be generated and written. If msg==NULL then no such entry will be written. Orthogonal to this we have a boolean flag REFLOG_TRUNCATE which is used to tell the transaction system to "truncate the reflog and thus discard all previous users". At the current time the only place where we use msg==NULL is also the place where we use REFLOG_TRUNCATE. Even though these two settings are currently only ever used together, it still makes sense to have them through two separate knobs. This allows future consumers of this API that may want to do things differently. For example someone can do: msg="Reflog truncated by Bob because ..." + REFLOG_TRUNCATE and have it truncate the log and have it start fresh with an initial message that explains the log was truncated. This API allows that. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: add a flag to allow reflog updates to truncate the logRonnie Sahlberg2014-10-222-3/+24
| | | | | | | | | Add a flag that allows us to truncate the reflog before we write the update. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: add a transaction function to append a reflog entryRonnie Sahlberg2014-10-222-2/+112
| | | | | | | | | | Define a new transaction update type, UPDATE_LOG, and a new function transaction_update_reflog. This function will lock the reflog and append an entry to it during transaction commit. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* copy.c: make copy_fd preserve meaningful errnoRonnie Sahlberg2014-10-221-5/+10
| | | | | | | | Update copy_fd to return a meaningful errno on failure. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: add a function to append a reflog entry to a fdRonnie Sahlberg2014-10-221-18/+30
| | | | | | | | | | | | | Break out the code to create the string and writing it to the file descriptor from log_ref_write and into a dedicated function log_ref_write_fd. For now this is only used from log_ref_write but later on we will call this function from reflog transactions too which means that we will end up with only a single place where we write a reflog entry to a file instead of the current two places (log_ref_write and builtin/reflog.c). Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: add a new update_type field to ref_updateRonnie Sahlberg2014-10-221-4/+23
| | | | | | | | | Add a field that describes what type of update this refers to. For now the only type is UPDATE_SHA1 but we will soon add more types. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: rename the transaction functionsRonnie Sahlberg2014-10-2212-127/+126
| | | | | | | | | | | | | | Rename the transaction functions. Remove the leading ref_ from the names and append _ref to the names for functions that create/delete/ update sha1 refs. This also makes the names more appropriate for future changes that have been discussed when the transactions could also operate on non ref objects. Such as ..git/config and .gitmodule. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c: make ref_transaction_delete a wrapper for ref_transaction_updateRonnie Sahlberg2014-10-222-21/+3
| | | | | | Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* refs.c make ref_transaction_create a wrapper to ref_transaction_updateRonnie Sahlberg2014-10-221-25/+2
| | | | | | | | | | The ref_transaction_update function can already be used to create refs by passing null_sha1 as the old_sha1 parameter. Simplify by replacing transaction_create with a thin wrapper. Signed-off-by: Ronnie Sahlberg <sahlberg@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update draft release notes to 2.2Junio C Hamano2014-10-211-4/+17
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'js/completion-hide-not-a-repo'Junio C Hamano2014-10-211-1/+2
|\ | | | | | | | | | | | | | | | | Some internal error messages leaked out of the bash completion when typing "git cmd <TAB>" and the machinery tried to complete refnames. * js/completion-hide-not-a-repo: completion: silence "fatal: Not a git repository" error
| * completion: silence "fatal: Not a git repository" errorjs/completion-hide-not-a-repoJohn Szakmeister2014-10-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | It is possible that a user is trying to run a git command and fail to realize that they are not in a git repository or working tree. When trying to complete an operation, __git_refs would fall to a degenerate case and attempt to use "git for-each-ref", which would emit the error. Hide this error message coming from "git for-each-ref". Signed-off-by: John Szakmeister <john@szakmeister.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'da/mergetool-meld'Junio C Hamano2014-10-212-2/+16
|\ \ | | | | | | | | | | | | | | | | | | | | | Newer versions of 'meld' breaks the auto-detection we use to see if they are new enough to support the `--output` option. * da/mergetool-meld: mergetools/meld: make usage of `--output` configurable and more robust
| * | mergetools/meld: make usage of `--output` configurable and more robustda/mergetool-meldDavid Aguilar2014-10-162-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Older versions of meld listed --output in `meld --help`. Newer versions only mention `meld [OPTIONS...]`. Improve the checks to catch these newer versions. Add a `mergetool.meld.hasOutput` configuration to allow overriding the heuristic. Reported-by: Andrey Novoseltsev <novoselt@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'da/mergetool-temporary-directory'Junio C Hamano2014-10-213-4/+60
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow a temporary directory specified to be used while running "git mergetool" backend. * da/mergetool-temporary-directory: t7610-mergetool: add test cases for mergetool.writeToTemp mergetool: add an option for writing to a temporary directory
| * | | t7610-mergetool: add test cases for mergetool.writeToTempda/mergetool-temporary-directoryDavid Aguilar2014-10-161-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests to ensure that filenames start with "./" when mergetool.writeToTemp is false and do not start with "./" when mergetool.writeToTemp is true. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | mergetool: add an option for writing to a temporary directoryDavid Aguilar2014-10-162-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach mergetool to write files in a temporary directory when 'mergetool.writeToTemp' is true. This is helpful for tools such as Eclipse which cannot cope with multiple copies of the same file in the worktree. Suggested-by: Charles Bailey <charles@hashpling.org> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'da/mergetool-tool-help'Junio C Hamano2014-10-214-14/+21
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow "git mergetool --help" to run outside a Git repository. * da/mergetool-tool-help: difftool: don't assume that default sh is sane mergetool: don't require a work tree for --tool-help git-sh-setup: move GIT_DIR initialization into a function mergetool: use more conservative temporary filenames test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: prefer test_config over git config
| * | | | difftool: don't assume that default sh is saneda/mergetool-tool-helpCharles Bailey2014-10-152-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git-difftool used to create a command list script containing $( ... ) and explicitly calls "sh -c" with this list. Instead, allow mergetool --tool-help to take a mode parameter and call mergetool directly to invoke the show_tool_help function. This mode parameter is intented for use solely by difftool. Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Helped-by: John Keeping <john@keeping.me.uk> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | mergetool: don't require a work tree for --tool-helpCharles Bailey2014-10-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Charles Bailey <cbailey32@bloomberg.net> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | git-sh-setup: move GIT_DIR initialization into a functionDavid Aguilar2014-10-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | mergetool: use more conservative temporary filenamesDavid Aguilar2014-10-151-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid filenames with multiple dots so that overly-picky tools do not misinterpret their extension. Previously, foo/bar.ext in the worktree would result in e.g. ./foo/bar.ext.BASE.1234.ext This can be improved by having only a single .ext and using underscore instead of dot so that the extension cannot be misinterpreted. The resulting path becomes: ./foo/bar_BASE_1234.ext Suggested-by: Sergio Ferrero <sferrero@ensoftcorp.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | test-lib-functions: adjust style to match CodingGuidelinesDavid Aguilar2014-10-151-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefer "test" over "[ ]" for conditionals. Prefer "$()" over backticks for command substitutions. Avoid control structures on a single line with semicolons. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | t7610-mergetool: prefer test_config over git configDavid Aguilar2014-10-151-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'da/mergetool-temporary-filename'Junio C Hamano2014-10-211-5/+11
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tweak the names of the three throw-away files "git mergetool" comes up with to feed the merge tool backend, so that a file with a single dot in its name in the original (e.g. "hello.c") will have only one dot in these variants (e.g. "hello_BASE_4321.c"). * da/mergetool-temporary-filename: mergetool: use more conservative temporary filenames
| * | | | mergetool: use more conservative temporary filenamesda/mergetool-temporary-filenameDavid Aguilar2014-10-161-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid filenames with multiple dots so that overly-picky tools do not misinterpret their extension. Previously, foo/bar.ext in the worktree would result in e.g. ./foo/bar.ext.BASE.1234.ext This can be improved by having only a single .ext and using underscore instead of dot so that the extension cannot be misinterpreted. The resulting path becomes: ./foo/bar_BASE_1234.ext Suggested-by: Sergio Ferrero <sferrero@ensoftcorp.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'da/mergetool-tests'Junio C Hamano2014-10-212-471/+469
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The clean-up of this test script was long overdue and is a very welcome change. * da/mergetool-tests: test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: use test_config to isolate tests t7610-mergetool: add missing && and remove commented-out code t7610-mergetool: use tabs instead of a mix of tabs and spaces
| * | | | test-lib-functions: adjust style to match CodingGuidelinesda/mergetool-testsDavid Aguilar2014-10-161-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefer "test" over "[ ]" for conditionals. Prefer "$()" over backticks for command substitutions. Avoid control structures on a single line with semicolons. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>