Commit Briefs

ad10f64ebe Thomas Adam

use a separate .cvg meta data directory for cvg(1) work trees

This prevents mixing the use of got and cvg clients in the same work tree. Avoids confusion going forward while cvg differentiates itself further. tog(1) and gotadmin(1) remain compatible with both work tree formats. These tools only read work trees to locate the corresponding repository.


3795e2b655 Thomas Adam

got: enable more commands to accept commit keywords

More work adding commit keyword support to the blame, cat, ref, tag, and tree commands. With this, all Got commands that take a <commit> option argument or operand now support keywords. Regress flub saved by op! fixes + ok op@


fb8851205d Thomas Adam

expand support for commit keywords to more got commands

Add the ability to use keywords in the backout, branch, checkout, cherrypick, and patch commands. Includes some basic regress tests for the new commands, and also some more contrived test cases for 'got log -c[:]keyword[:(+|-)[N]]'. ok stsp


9139e0049a Thomas Adam

implement support for keywords as got <commit> arguments

This begins enabling the use of keywords in got wherever commit ids or references are used, with more work intended to expand support across all such instances (e.g., branch, checkout, etc.), and add more keywords. The keywords ":base" and ":head" can be passed to 'got {diff,log,update} -c' commands as a substitute for the corresponding commit hash id. Keywords and references can also be modified by appending a ':+' or ':-' and an optional integer N to specify by first parent traversal the Nth generation descendant or antecedent, respectively. If N is omitted, a '1' is implicitly appended. tweaks + ok op and stsp


bccae03fdb Thomas Adam

abort histedit if the user quits the editor without saving the script

Also document that the commit/import/tag operations are aborted when the user fails to save the log message from the invoked editor. ok jamsek stsp


b40793acff Thomas Adam

always report stat() error with path

ok stsp


ff8a85aa6e Thomas Adam

plug got_object_id leak in cmd_log()

ok stsp@


dcd455ee64 Thomas Adam

fix option processing for 'got merge'

Don't make -C imply -c (a break statement was missing). Detect -an and -cn conflicts. Simplify by removing unneeded check for conflicting -aC (since -C requires -c, we can rely on the -ac conflict being detected). Update the man page to say -cC is allowed.


31009ade0d Thomas Adam

add -M option: tell got merge not to fast-forward

ok stsp@


0619bbce0e Thomas Adam

reword user-facing error message which mentions "fast-forward"

For user-facing messages it is better to avoid technical jargon like this and instead spell out what the fast-forward situation implies: that one branch is already based on another. ok jamsek


4434a15a47 Thomas Adam

prevent 'got merge' from creating commits on branches outside of "refs/heads/"

ok op, james


2b72f32d68 Thomas Adam

Implement fast-forward merges.

Split part of got_worktree_merge_prepare into a new function, got_worktree_merge_write_refs, since that part doesn't make sense in the fast-forward case. ok stsp@


9fecc8d045 Thomas Adam

make 'got tree /' succeed in a work tree

Previously, this command would trigger an error: got: /: bad path


102d840de7 Thomas Adam

dropping unnecessary strlen()s

ok jamsek, stsp


9e26f05792 Thomas Adam

avoid strlen in for(;;)

ok jamsek, stsp


081e3dc235 Thomas Adam

got, tog: correctly skip HEAD in build_refs_str()

s[strlen(s)] == '\0' is banally always true, the intent was to not skip refs that starts with "HEAD". style nit / ok stsp@



fe3f264bd2 Thomas Adam

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


d8a7bd7ded Thomas Adam

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.


a4c8ed779e Thomas Adam

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


1faec3fb1a Thomas Adam

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

ok op@


4d0b6596a3 Thomas Adam

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@


e9e7947043 Thomas Adam

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@


664d70035d Thomas Adam

fix crash in got log due to NULL-deref in got_object_blob_close

Reported by Mikhail (thanks!), ok jamsek


67fdb8a7a3 Thomas Adam

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