Commits


make 'got merge -c' fail even if new changes only affect unrelated paths Otherwise, 'got merge -c' can silently revert already committed changes. Also fix GOT_ERR_MERGE_COMMIT_OUT_OF_DATE by giving it a value distinct from GOT_ERR_MERGE_STAGED_PATHS. Patch by James Cook


make "got merge" refuse to run if a merge is in progress and the -a or -c option wasn't passed. Patch by James Cook.


simplify ancestry checks in checkout, update, rebase, and merge No behaviour change as the end result of the rewritten checks should be the same as before. We are just doing less work where possible. Patch by James Cook


make 'got patch' display statistics about files with conflicts and rejects ok op@


got: flush stdout before printing the error in main() Since standard error is unbuffered, it could happen that the error string is printed immediately while the output from the subcommand is stuck in a buffer and written later. So flush() standard output before printing the error message. Problem reported by naddy@, ok stsp@


consistently close the struct repository on every cmd_*() Spotted while looking for leaks using Otto' malloc() new leaks detection. Harmless in practice since we just forgot to call got_repo_close() when terminating in some cmd_*() functions, but still a leak. ok stsp@


fix crash in got log due to NULL-deref in got_object_blob_close Reported by Mikhail (thanks!), ok jamsek


Close the message template file before calling edit_logmsg(). Fixes a race condition on NFS where the file's modify time may change while the file is being edited, causing the editor to complain. OK stsp


histedit_parse_list: avoid needless free(line) getline(3) allows to safely re-use the storage. While here rename `size' to `linesize', `len' to `linelen', and properly initialize `linesize' to zero; suggested by tb@ ok tb@


fall back to vi(1) instead of ed(1) if neither EDITOR nor VISUAL are set ed users are reading files with their minds rather then their eyes, and might therefore be missing important visual clues we write into files before the user gets to edit them. Use of vi(1) ensures that such clues will not be missed.


include sha2.h too where sha1.h is included In preparation for wide sha256 support; stsp@ agrees. Change done mechanically with find . -iname \*.[cy] -exec sam {} + X ,x/<sha1\.h>/i/\n#include <sha2.h>


fix 'got merge' so it parses gitconfig for author cmd_merge is the only subcommand that may create commits that doesn't parse the git config files, thusly failing for users without GOT_AUTHOR defined. Problem reported by James Cook who also provided an initial test case, thanks! ok jamsek


add ci/he/mg/rb -C option to commit unresolved conflicts As per stsp's suggestion and building on his initial diff, add the -C option to enable creating commits with unresolved conflicts to the commit, histedit, merge, and rebase commands to allow continuing the operation despite files in conflict status. Also, only search for conflict markers in newly added lines to enable working with files already under version control that may have conflict markers embedded verbatim. lots of tweaks, improvements, and initial diff + ok stsp@


got: further fetch tweaks to prevent unintended fetches Implement stsp's suggestion to only fetch remote's HEAD if the symref refs/remote/*/HEAD exists, and its target no longer matches the remote HEAD. This ensures users tracking a project won't miss a change in HEAD, while also fixing the issue reported by naddy where HEAD was fetched by default even though a specific, potentially less active, branch is cloned, resulting in a repository with more commits than necessary. In addition, unless 'got fetch -b <branch>' is used, the remote HEAD branch will be fetched if branches are not set in got.conf and there is no work tree to ascertain a branch, or said branches are not found on the server. ok stsp@


add -n to 'got commit' usage; patch by Josiah Frentsos