Commits
- Commit:
e96d39bf87c8025d794e9c5c5bfcbbca58c216ac
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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@
- Commit:
5a53ca9d31c0ec26e10887fb404d63242df55002
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
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.
- Commit:
5822e79e39a8777984e08b5d89a8c55d6aa0356d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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>
- Commit:
d51d11be9ba86c2c5cf8d36994e56eeccb905865
- From:
- Omar Polo <op@omarpolo.com>
- Date:
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
- Commit:
123836732402b1204e5be68f98a69084285c316d
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
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@
- Commit:
118a625d39930284f891ea1285efc17fb3848cae
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
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@
- Commit:
0e0165f13a58bad062d9761626c1b3ba82df671c
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Mark Jamsek <mark@jamsek.dev>
- Date:
add -n to 'got commit' usage; patch by Josiah Frentsos
- Commit:
4bff57b4b66990d6829cb83645d1f1d478ae0cea
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
backout got: always fetch remote HEAD except when -b is used
As pointed out by naddy, this behaviour is not ideal when users
want to limit their repository to a particular branch which will
diverge from HEAD over time, such as -stable branches.
See https://marc.gameoftrees.org/mail/1676388048.8632_0.html
- Commit:
2a19e2e21a876bbc4ae1999ca08ce4c8f2002158
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: always fetch remote HEAD except when -b is used
Rather than only fetch HEAD when there are no branches set in got.conf and
there is no branch to be inferred from a work tree, or said branches don't
exist on the server, always fetch HEAD unless 'got fetch -b branch' is used.
ok stsp@
- Commit:
a4515c6608c1b685bfa9187b2517b44773a11068
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: drop commit -A $GOT_AUTHOR restriction
As discussed with op and stsp on irc, this prevents the valid case of
changing a commit's author to yourself during a histedit operation, and
potentially blocks other valid use cases too.
ok stsp@ and op@
- Commit:
1fa0d17d767f8e443af3b4493f3f2af0e759dda9
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got/tog/gotadmin: pledge earlier
In the case of tog move setlocale(3) before pledge(2), as suggested by
stsp.
ok stsp@
- Commit:
0dd7613ce65424868ec86f0623e38eb70d9a9321
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
special case 'got fetch -b <branch>' to only fetch <branch>
As discussed on irc, this drops the implicit remote HEAD fetch when -b is used.
got.1 has been updated to make the new fetch behaviour clear.
ok stsp@
- Commit:
faf054c3d5fbad3a55534ebe525d58156c7aad27
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make new log message modication check more robust; fixes regress fallout
ok jamsek
- Commit:
ccc835f12a86459f480a7ea4b724af67cd0889a7
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
garbage-collect redundant read_logmsg() parameter
As identified and suggested by stsp, with the previous commit,
'strip_comments' is now always set thus no longer needed.
ok stsp@
- Commit:
93436ccdaf0945f5fdb4b5cd2b90c9ac0bb14c83
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: use timestamp and emptiness to validate log message
As suggested by naddy: consider commit log messages valid provided the temp
file time stamp has changed and the file is not empty. This heuristic
provides the desired behaviour (i.e., reusing cherrypicked/backed-out log
messages) that's currently provided but is simpler to grok.
Improved by and ok stsp@
- Commit:
91a3781a11d1b2c483221d9dca87d72aea17637b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make edits made to comments count as a log message modification
This supports use of cherrypick/backout without requiring the user
to modify the log message of the original commit.
ok jamsek, op
- Commit:
704b1cf77bf5aa6f9aeed7bca0b34c53cc2183c2
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
only fetch the work tree's branch by default if it is inside "refs/heads/"
ok jamsek
- Commit:
188f8dcf2c1c15bf37859e3b587bc6331fd5a097
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix interaction of 'got fetch -b', got.conf, and work tree
Without branches in got.conf for a remote, and without -b/-R options,
the fallback to HEAD would only work when not invoked in a work tree.
With this fix 'got fetch' should behave as described in the man page.
The -b option now overrides both got.conf and the fallback to the work
tree's branch.
And fallback to HEAD works as expected when invoked in a repository.
Also, do not strictly require remote repositories to provide a branch
from the refs/heads/ namespace. In such cases users should be able to
use -R to select something to fetch.
ok jamsek
- Commit:
ccbbf026bf5917a8d66564fcce9184b29412432b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
improve 'got fetch' behaviour when work tree's branch is not on server
Only fetch the work tree's branch if the -b option is not specified.
This keeps -b functional as an override when invoked in a work tree.
Our previous changes did not consider that got.conf is also a source
of lists of branches to fetch, and that -b is supposed to work as an
override of any default behaviour. We were implicitly appending the
work tree's branch as if it was mentioned as an override on the
command line, which was wrong and based on a misunderstanding of
the intended behaviour.
Without -b on the command line we obtain a list of branches to fetch
from got.conf and use this list if it is not empty. The repository's
HEAD will be fetched only if neither the -b option, nor got.conf, nor
a work tree tell us what to fetch.
Make the man page more clear by moving the explanation of the default
behaviour into the main section of 'got fetch', leaving the -a and -b
option descriptions free of such details.
ok jamsek
- Commit:
c33c3763d3c9e005bb51d9d3a6aab3bedc50bf2e
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
fix mistaken instances returning NULL instead of err
While here, for consistency, check dup() return value for -1 rather than < 0.
ok stsp@
- Commit:
ddb2df58a374b7058f0d3044c25b821680bd3345
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: make fetch default to the work tree's current branch
As per stsp's todo item, if invoked in a work tree, make 'got fetch' default
to fetching the work tree's current branch instead of the branch pointed to
by the remote repository's HEAD.
ok stsp@ and op@
- Commit:
ef85a376d8f41068fa9c6b11bc1fff98e3e9520c
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
zap unused parameter in got_worktree_rebase_complete()
ok stsp@
- Commit:
36fdf003886958dce2c912acd082b3e9cfe88979
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
return err instead of NULL in got.c:print_backup_ref()
ok stsp@
- Commit:
3506a2b1c255a8d362e1cce0a8b594c9fb17bb37
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
free cwd in cmd_backout() and cmd_cherrypick()
ok stsp@
- Commit:
980c6786a419950816c67eb1b53e021ebdfe483c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'got rebase' work when the to-be-rebased branch has no parent commit
found by and ok op@, who also provided the test case