summaryrefslogtreecommitdiff
path: root/src/rebase.c
Commit message (Collapse)AuthorAgeFilesLines
* rebase: orig_head and onto accessorsErik Aigner2019-04-211-0/+16
| | | | | | | | The rebase struct stores fields with information about the current rebase process, which were not accessible via a public interface. Accessors for getting the `orig_head` and `onto` branch names and object ids have been added.
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-28/+28
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-011-2/+2
| | | | Use the new object_type enumeration names within the codebase.
* global: replace remaining use of `git__strtol32`Patrick Steinhardt2018-10-181-1/+1
| | | | | | | Replace remaining uses of the `git__strtol32` function. While these uses are all safe as the strings were either sanitized or from a trusted source, we want to remove `git__strtol32` altogether to avoid future misuse.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-19/+19
|
* checkout: change default strategy to SAFEEtienne Samson2018-03-261-3/+0
| | | As per #4200, our default is quite surprising to users that expect checkout to just "do the thing".
* Make sure to always include "common.h" firstPatrick Steinhardt2017-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
* Merge pull request #4030 from libgit2/ethomson/fsyncEdward Thomson2017-03-221-9/+9
|\ | | | | fsync all the things
| * git_futils_writebuffer: default only when flags==0Edward Thomson2017-02-281-9/+9
| | | | | | | | | | Only use defaults for `git_futils_writebuffer` when flags == 0, lest (1 << 31) be treated as the defaults.
* | rebase: ignore untracked files in submodulesDavid Turner2017-03-031-1/+3
|/ | | | | | | | | An untracked file in a submodule should not prevent a rebase from starting. Even if the submodule's SHA is changed, and that file would conflict with a new tracked file, it's still OK to start the rebase and discover the conflict later. Signed-off-by: David Turner <dturner@twosigma.com>
* repository: rename `path_repository` and `path_gitlink`Patrick Steinhardt2017-02-131-3/+3
| | | | | | | | | | | | | The `path_repository` variable is actually confusing to think about, as it is not always clear what the repository actually is. It may either be the path to the folder containing worktree and .git directory, the path to .git itself, a worktree or something entirely different. Actually, the intent of the variable is to hold the path to the gitdir, which is either the .git directory or the bare repository. Rename the variable to `gitdir` to avoid confusion. While at it, also rename `path_gitlink` to `gitlink` to improve consistency.
* giterr_set: consistent error messagesEdward Thomson2016-12-291-12/+12
| | | | | | | | Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
* rebase: check the result code of rebase_init_mergeJacques Germishuys2016-12-291-1/+1
|
* git_rebase_init: correctly handle detached HEADDavid Turner2016-12-011-1/+1
| | | | | | | | git_rebase_finish relies on head_detached being set, but rebase_init_merge was only setting it when branch->ref_name was unset. But branch->ref_name would be set to "HEAD" in the case of detached HEAD being either implicitly (NULL) or explicitly passed to git_rebase_init.
* rebase: don't ask for time sortingCarlos Martín Nieto2016-10-061-1/+1
| | | | | | `git-rebase--merge` does not ask for time sorting, but uses the default. We now produce the same default time-ordered output as git, so make us of that since it's not always the same output as our time sorting.
* rebase: change assertion to avoidEdward Thomson2016-06-011-4/+1
| | | | | | | It looks like we're getting the operation and not doing anything with it, when in fact we are asserting that it's not null. Simply assert that we are within the operation boundary instead of using the `git_array_get` macro to do this for us.
* rebase: handle no common ancestor for inmemoryethomson/rebase_inmemory_no_baseEdward Thomson2016-05-031-4/+15
|
* rebase: correctly finish rebasing detached headsethomson/rebase_detachedEdward Thomson2016-04-211-24/+35
| | | | | When rebasing with IDs, we do not return to the `branch`, we remain in a detached HEAD state.
* rebase: handle detached HEADs in `init`Edward Thomson2016-04-211-3/+11
| | | | | | When `init`ing a rebase from a detached HEAD, be sure to remember that we were in a detached HEAD state so that we can correctly `abort` the object that we just created.
* rebase: plug memory leak in `rebase_alloc`Patrick Steinhardt2016-02-231-10/+12
| | | | | | | Convert `rebase_alloc` to use our usual error propagation patterns, that is accept an out-parameter and return an error code that is to be checked by the caller. This allows us to use the GITERR_CHECK_ALLOC macro, which helps static analysis.
* rebase: persist a single in-memory indexEdward Thomson2016-02-151-12/+23
| | | | | | When performing an in-memory rebase, keep a single index for the duration, so that callers have the expected index lifecycle and do not hold on to an index that is free'd out from under them.
* rebase: allow custom merge_optionsEdward Thomson2016-02-111-2/+2
| | | | | | Allow callers of rebase to specify custom merge options. This may allow custom conflict resolution, or failing fast when conflicts are detected.
* rebase: introduce inmemory rebasingEdward Thomson2016-02-111-117/+250
| | | | | | | | | | Introduce the ability to rebase in-memory or in a bare repository. When `rebase_options.inmemory` is specified, the resultant `git_rebase` session will not be persisted to disk. Callers may still analyze the rebase operations, resolve any conflicts against the in-memory index and create the commits. Neither `HEAD` nor the working directory will be updated during this process.
* Fix #3094 - improve use of portable size_t/ssize_t format specifiers.Matthew Plough2015-07-121-2/+2
| | | | The header src/cc-compat.h defines portable format specifiers PRIuZ, PRIdZ, and PRIxZ. The original report highlighted the need to use these specifiers in examples/network/fetch.c. For this commit, I checked all C source and header files not in deps/ and transitioned to the appropriate format specifier where appropriate.
* Initialize a few variablesCarlos Martín Nieto2015-06-091-1/+1
| | | | | | Coverity complains about the git_rawobj ones because we use a loop in which we keep remembering the old version, and we end up copying our object as the base, so we want to have the data pointer be NULL.
* rebase: include checkout opts within rebase optsEdward Thomson2015-04-201-14/+6
|
* rebase: init and open take a rebase_optionsEdward Thomson2015-04-201-114/+118
| | | | | | `git_rebase_init` and `git_rebase_open` should take a `git_rebase_options` and use it for future rebase operations on that `rebase` object.
* rebase: take `checkout_options` where appropriateEdward Thomson2015-04-201-15/+29
|
* rebase: block rebase_commit with unstaged changesEdward Thomson2015-04-201-20/+30
|
* rebase: identify a rebase that has not startedEdward Thomson2015-04-201-1/+1
| | | | | | In `git_rebase_operation_current()`, indicate when a rebase has not started (with `GIT_REBASE_NO_OPERATION`) rather than conflating that with the first operation being in-progress.
* Plug a few leaksCarlos Martín Nieto2015-03-041-2/+2
|
* reset: remove reflog message overrideCarlos Martín Nieto2015-03-031-1/+1
| | | | | This function is meant to simulate what git does in the reset command, so we should include the reflog message in that.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-11/+12
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* rebase: check alloc resultEdward Thomson2015-02-271-0/+1
|
* Merge pull request #2831 from ethomson/merge_lockCarlos Martín Nieto2015-02-151-6/+9
|\ | | | | merge: lock index during the merge (not just checkout)
| * indexwriter: an indexwriter for repo operationsEdward Thomson2015-02-141-22/+8
| | | | | | | | | | Provide git_indexwriter_init_for_operation for the common locking pattern in merge, rebase, revert and cherry-pick.
| * merge-like operations: lock index while workingEdward Thomson2015-02-141-3/+20
| |
* | rebase: `CHECKOUT_SAFE` instead of `FORCE`Edward Thomson2015-02-131-8/+12
| | | | | | | | | | Switch to a standard branch-switching pattern of a `SAFE` checkout, then updating `HEAD`.
* | rebase: allow `NULL` branch to indicate `HEAD`Edward Thomson2015-02-131-2/+16
| | | | | | | | | | Don't require the branch to rebase, if given `NULL`, simply look up `HEAD`.
* | rebase: provide NULL `exec` on non-EXEC operationsEdward Thomson2015-02-131-9/+28
|/ | | | | Users may want to try to pay attention to the `exec` field on all rebase operations.
* Check rebase options version on public entry pointsjamill/rebase_opt_ver_checkJameson Miller2015-02-121-1/+3
|
* Check the result of git_buf_joinpathJacques Germishuys2014-12-301-1/+2
|
* Plug some leaksJacques Germishuys2014-12-291-1/+2
|
* notes: move the notes name argumentCarlos Martín Nieto2014-12-061-2/+2
| | | | | Make it consistent between git_note_create() and git_note_remote() by putting it after the repository.
* rebase: updates based on PR commentsEdward Thomson2014-10-261-17/+31
|
* s/git_merge_head/git_annotated_commitEdward Thomson2014-10-261-19/+21
| | | | | Rename git_merge_head to git_annotated_commit, as it becomes used in more operations than just merge.
* rebase: clean up some warnings and memory leaksEdward Thomson2014-10-261-26/+14
|
* rebase: oid member of operation should be constEdward Thomson2014-10-261-2/+2
|
* git_rebase: iterators for operationsEdward Thomson2014-10-261-0/+21
|
* rebase: preload all operationsEdward Thomson2014-10-261-111/+151
|