Download raw body.
Some random whining
On Wed, Sep 01, 2021 at 05:09:06PM +0200, Stefan Sperling wrote: > On Wed, Sep 01, 2021 at 01:39:47PM +0200, Christian Weisgerber wrote: > > I'll just whine about some random things I noticed while using got: > > > > * "got cherrypick" is slow in a large tree like OpenBSD ports. > > This is mostly because of pre-condition checks that run before the actual > cherrypick operation. It is the cost of running 'got log' on the branch. > > I'm aware of this and already tried to find another way to do this but > could not find any way. The downside of removing the checks would be > that cherrypick could be used in non-sensical ways between branches > that aren't related (or against a branch itself). > On the other hand, experienced users will know how to use it as intended. > So perhaps the checks could be dropped if the performance benefit > outweighs the potential usability issues created when someone attempts > using this command in a non-sensical way. Try this patch. I'd be fine with this if people prefer performance over sanity checks. diff 0e33f8e0becf732ab33b3ce78c026790a651a5f9 /home/stsp/src/got blob - 02e13d54951c31a8f0e635a8f07be977d6861681 file + got/got.1 --- got/got.1 +++ got/got.1 @@ -1582,7 +1582,7 @@ Merge changes from a single into the work tree. The specified .Ar commit -must be on a different branch than the work tree's base commit. +should be on a different branch than the work tree's base commit. The expected argument is a reference or a commit ID SHA1 hash. An abbreviated hash argument will be expanded to a full SHA1 hash automatically, provided the abbreviation is unique. @@ -1626,7 +1626,7 @@ Reverse-merge changes from a single into the work tree. The specified .Ar commit -must be on the same branch as the work tree's base commit. +should be on the same branch as the work tree's base commit. The expected argument is a reference or a commit ID SHA1 hash. An abbreviated hash argument will be expanded to a full SHA1 hash automatically, provided the abbreviation is unique. blob - 51bedeed3942da484d0dfe4614307f848dcbd5ed file + got/got.c --- got/got.c +++ got/got.c @@ -7971,16 +7971,6 @@ cmd_cherrypick(int argc, char *argv[]) if (error != NULL) goto done; - error = check_same_branch(commit_id, head_ref, NULL, repo); - if (error) { - if (error->code != GOT_ERR_ANCESTRY) - goto done; - error = NULL; - } else { - error = got_error(GOT_ERR_SAME_BRANCH); - goto done; - } - error = got_object_open_as_commit(&commit, repo, commit_id); if (error) goto done; @@ -8096,10 +8086,6 @@ cmd_backout(int argc, char *argv[]) if (error != NULL) goto done; - error = check_same_branch(commit_id, head_ref, NULL, repo); - if (error) - goto done; - error = got_object_open_as_commit(&commit, repo, commit_id); if (error) goto done;
Some random whining