Commit Graph
48 Commits
Author SHA1 Message Date
Caolán McNamara fcbb911c70 add example of %notify=NONE and %notify=OWNER
Change-Id: Icda847105524c9021b3105c85cc1f4d949c2d1c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191777
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2025-10-02 18:57:08 +02:00
Mike Kaganski 982342138e Inline 'submit', and allow separate 'wip'/'private'
Now it's possible to run something like

  ./logerrit submit "" wip

to auto-guess the branch, and make it WIP.

Change-Id: I099a840ad39a1674c7dc5851c0a0c1d3976ee728
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178401
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-12-13 11:26:42 +01:00
Mike Kaganski 3abe4b62e5 Deduplicate a bit
Change-Id: I5e0ec4adc79f81ff81d7cfe54e2f1a637b5d7f43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178397
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
2024-12-13 10:45:38 +01:00
Mike Kaganski b6c10f89e2 When no branch is specified, fallback to the tracked branch first
This allows to work in a branch foo, which tracks e.g. master, and
using plain ./logerrit submit, have it submit to master properly.

Change-Id: I7aaff759392250a5380853cbaea0f892461c1d77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165984
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-04-11 14:08:29 +02:00
Moritz Duge 80f823c84e Fix indentation
Change-Id: Iabbdd5507493e2d8e7c635ff53d2e6762944df0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165755
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2024-04-04 15:26:09 +02:00
Hossein 22483334bf Use ed25519 as default for ssh key pair generation
Use ed25519 algorithms as the default key pair generation algorithm
for the public key cryptography used by ssh in order to submit
patches via 'logerrit' script. If ed25519 is not available, RSA is
used.

List of supported algorithms in OpenSSH can be obtained by invoking
this command:

    ssh -Q key

Change-Id: I12ebcbb62d0752c94b8c2d5225223ceb69b7fe79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122765
Reviewed-by: guilhem <guilhem@libreoffice.org>
Tested-by: Hossein <hossein@libreoffice.org>
2021-09-29 09:34:21 +02:00
Ilmari Lauhakangas d65f6ba081 Make logerrit more portable
Change-Id: I4b63de105abc292dcbb461a9a6dd846523e51eb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118779
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-07-13 10:28:36 +02:00
Ilmari Lauhakangas 1add28ba7e logerrit: drop some subcommands in favour of Gerrit defaults
submit-wip and submit-private don't really add value

Change-Id: I4e30b213f5d6317538aad73fcb68e14e7cbb5032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116198
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-06-01 16:39:03 +02:00
Noel Grandin 1421961635 fix logerrit on mac
where my initial commit seems not to have done the job.

Change-Id: I437df21fc5164eace48c8a2dc093e2c3dcc37826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113661
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-06 15:22:41 +02:00
Mike Kaganski 34d58fb8e8 Cygwin/MINGW also use '--date'
Change-Id: Icd0ad5e304d8479a56552dc8ff00b3bddab0ecf6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112466
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-14 12:32:22 +01:00
Noel 3646ab5837 and fix logerrit on linux again
after I broke it with
    commit 69959235c3
    Date:   Tue Mar 9 19:29:19 2021 +0200
    adapt recent change to macOS

Change-Id: Ib58e9903839143fdf6e84a04d532f70a8212f984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112269
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-11 07:44:03 +01:00
Noel Grandin 69959235c3 adapt recent change to macOS
... from
    commit e7a471a8fb
    logerrit: do not submit if parent is older than a week

Change-Id: Icd1ee7f66dbbcef90add9e4ddecfdb9bbc0900e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112234
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-10 11:21:50 +01:00
Xisco Fauli e7a471a8fb logerrit: do not submit if parent is older than a week
Change-Id: Ieb20b3086082bd0a88e457b0ae922234ce737b8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112009
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-08 09:27:19 +01:00
Jan-Marek Glogowski 6a97decccb Add an optional Gerrit change ID to testfeature
This way it's possible to have all test runs in a single change,
so it's easier to check different results.

Change-Id: I1aa3a229f5ee3ba12dbd2c18328d34c8a4528c07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99688
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2020-07-30 12:48:37 +02:00
Guilhem Moulin 3c0eaef500 logerrit: Don't suggest to set oneself a username.
Usernames (used for HTTP and SSH authentication) are now automatically
provisioned from SSO (along with the primary email address and display
name).  Username/email collisions are fatal and need manual resolution,
but for most users the registration step should be somewhat simpler.

Also, update the documentation to reflect /settings/#SSHKeys from gerrit
3.0's UI.

Change-Id: Ia634c2f92f42b4b698543d990534ac15215a4c96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94931
Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org>
Tested-by: Jenkins
2020-05-27 16:19:43 +02:00
Noel Grandin 6ad2ec4e98 fix get_SHA_for_change in logerrit script
after
    commit 02b5d09c0d
    tdf#105204 fix shellcheck warnings in logerrit
the previous get_SHA_for_change returned a URL with a leading space,
which was previously implicitly stripped. Adding quotes prevents that
stripping, so we need to explicitly strip here

Change-Id: I5b303f6ca5b1dc7d2a369afc2c52830b1b9586eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89816
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-02 13:17:08 +01:00
Ilmari Lauhakangas 02b5d09c0d tdf#105204 fix shellcheck warnings in logerrit
- double quote to prevent globbing and word splitting
- use read with -r
- handle pushd and popd failures
- escape arguments to ssh (thanks to Guilhem for the solution)

Change-Id: I5fcbb0248779a4fe3c0e50a9597874bcbf8217e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89643
Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org>
Tested-by: Jenkins
2020-02-28 23:10:30 +01:00
Guilhem Moulin d144fe04e7 logerrit: Upgrade URIs to https://
Change-Id: I0dc259178e5df6334a13ab04850ec662499fe7d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86821
Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org>
Tested-by: Jenkins
2020-01-16 01:01:58 +01:00
Guilhem Moulin 1e6428deed logerrit setup: refactor key-based SSH handling
* Don't select existing ~/.ssh/id_dsa.pub.  Since 7.0 (released
   2015-08-11) OpenSSH servers won't accept DSA user keys anyway, so
   users have likely rotated their legacy key material by now.

 * The pubkey to copy into gerrit is derived from the first existing file
   among ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519, and ~/.ssh/id_rsa.  These
   algorithms are ordered as found in PubkeyAcceptedKeyTypes' default
   value as of OpenSSH 8.1.  (EC keys are only supported since Gerrit
   1.14.)  Generate an RSA key when ~/.ssh doesn't exist, as before,
   since it's still the default in ssh-keygen(1) from OpenSSH 8.1.

 * In the ssh_config(5) stanza, only include the IdentityFile when a
   the private key file exists.  The private key material might reside
   somewhere else, for instance in a smartcard or in an external agent's
   key store; in both cases the ssh client can authenticate the user
   without direct access to the key material.  While it's possible to
   set IdentityFile to a pubkey (with IdentitiesOnly={yes,no}) it's not
   documented and thus shouldn't be used.

Change-Id: Id73a2798747ce5c394b0cf2d0dc40107a1f2c599
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86858
Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org>
Tested-by: Guilhem Moulin <guilhem@libreoffice.org>
2020-01-16 00:01:03 +01:00
Guilhem Moulin 9276b11735 logerrit: atomically create ~/.ssh with restrictive mode
AFAICT `mkdir [-m mode]` is already defined in POSIX.1-1990.

Change-Id: I159578eac16398f16d55578fbd818906b77cf373
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86852
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-15 23:51:17 +01:00
Ilmari Lauhakangas 4322cdab98 logerrit: support submitting private and wip changes
Change-Id: I0ee3ac887e17b38b6a2c501bcf6a2132406f1d20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86273
Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-06 20:43:52 +01:00
Andrea Gelmini 89560df40f Fix typo
Change-Id: I80aae5ad98e7275bd266e1295e6988dc202649a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85840
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-26 13:50:47 +01:00
Andrea Gelmini 77902a3cb2 Fixing '....'
Change-Id: Icf2a34500acc18b28f113c85366bf24edc6d20b9
Reviewed-on: https://gerrit.libreoffice.org/78695
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-09-06 14:12:27 +02:00
Andrea Gelmini 22f94eb4f7 Fix typo
Change-Id: Ie8919bff20c7b29a3fee7a25bba65550b3fd086d
Reviewed-on: https://gerrit.libreoffice.org/68726
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-03-05 07:13:49 +01:00
Shinnok b9ddf19ca1 Improve error message on ssh login failure.
Also use the GERRITHOST variable instead of magic text.

Change-Id: I3314be81017f64fca8aa756cca1715081ad01641
Reviewed-on: https://gerrit.libreoffice.org/41988
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2017-09-06 16:07:50 +02:00
qarkai d33d2a65a4 tdf#105204 fix shellcheck warnings in logerrit
Change shebang to bash since -p option is used in read command,
use $(..) instead of `..`,
double quote to prevent word splitting,
handle cd failure.

Change-Id: I2ae00bbd21754136610504f2ff6818b8d3695cc4
Reviewed-on: https://gerrit.libreoffice.org/33089
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
2017-01-17 06:39:16 +00:00
Michael Stahl 7895f7e1a8 logerrit: disarm the "resubmit" foot-gun
Recently some new developers accidentally used "resubmit", intending to
upload a new revision of their change, but it actually always creates a
new gerrit change.

4e15809a78 claims that "resubmit creates a
new Change-Id for the current change and thus allow to submit changes for
review on release branches that were already reviewed on master", but
that is not actually required with gerrit versions that were in use in
the recent years, gerrit is capable of tracking Change-Id per branch.

Change-Id: I66eda4dbc6f4ff1e235105b3f55041cda88a6b60
2016-04-27 15:52:40 +02:00
Bjoern Michaelsen ef4fd9c52f add ./logerrit testfeature
- ./logerrit testfeature will trigger a testbuild of the
  current feature branch as it is on gerrit
- ./logerrit testfeature $BRANCH will do the same for $BRANCH
- cloning to a tempdir and rm -rf'ing around isnt ideal, so
  consider this as a template for your own scripting

Change-Id: I50a3c80748af82d855522f245ddbff227c8adab2
2015-06-10 18:05:34 +02:00
Mathieu Parent b4f3b3579a logerrit: Simplify SSH config
Change-Id: Ic8196ebfeef64270fcd42b44e485a2618472f184
Reviewed-on: https://gerrit.libreoffice.org/11788
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-10-05 15:49:49 +00:00
Bjoern Michaelsen b910d1d9b7 add wiki-link to logerrit
Change-Id: I44dee045cef9227b62666ed08206a342fe37b18c
2013-03-29 02:03:56 +01:00
Michael Meeks e8943d60fc logerrit setup - automate lots more for first-time users. 2013-03-27 17:26:50 +00:00
Bjoern Michaelsen d588e1cf1d kill './logerrit review'
- twas more of a proof-of-concept anyway
- its more clumsy than both:
  - git-review https://wiki.documentfoundation.org/Development/GitReview
  - or simply using the web UI

Change-Id: Id7a11fcdaf95386c451d0e6421d32de7d1d02721
Reviewed-on: https://gerrit.libreoffice.org/3070
Reviewed-by: Thorsten Behrens <tbehrens@suse.com>
Tested-by: Thorsten Behrens <tbehrens@suse.com>
2013-03-27 12:22:06 +00:00
Bjoern Michaelsen 8c8dc548c8 make ./logerrit setup hooks just to be sure
Change-Id: I17adc7cecd5cf3757d92477dacff24e46e92caab
2013-03-26 23:20:56 +01:00
Bjoern Michaelsen 53a536c68f first time gerrit users register, they do not sign in
Change-Id: I058a0b445f8b7f286ed4c22d40c0770d435d0e40
2013-03-26 23:15:11 +01:00
Miklos Vajna 1ed4210d8e logerrit: kill copy-paste
Change-Id: I2478ef0f886867c2d2247febf1b29b90fd32e5e7
2013-03-26 16:21:37 +01:00
Bjoern Michaelsen 15e9f568fd add draft-submittal to logerrit and retab
Change-Id: I5f52d9c81c28c9a4b23eaf043e7b67b1fc6d82d9
2013-03-26 15:40:26 +01:00
Bjoern Michaelsen 646b992ee3 add a setup walkthrough to ./logerrit
Change-Id: Id041aa5a8fbb06626b7310aa76471db993b53cf0
2013-03-26 15:40:26 +01:00
Philipp Weissenbacher 85c7f925a2 Print help text if no subcommand is provided
Change-Id: Id9abc3ab45af8b6e44904090e179ce67a3f45796
Reviewed-on: https://gerrit.libreoffice.org/2541
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2013-03-04 21:41:41 +00:00
Petr Mladek 7d88c35cc3 logerrit: print logerrit help with --help
It printed help of the plain gerrit tool which always confused me :-)

Change-Id: Ied81688ada4b536486d998709230fc24fa3c9b62
2013-02-01 18:12:58 +01:00
Miklos Vajna f9fa180e42 logerrit: --code-review=2 in review implies --submit
Change-Id: Ibd21dfdb76536ea0e0a71791a91ec87e31d49960
2012-08-22 14:15:14 +02:00
Tim Retout e06c1f56b9 logerrit: Fix some typos.
Change-Id: I0d6f3f5521d32dad1ffaa8675d5f43c7d7fa7cea
Reviewed-on: https://gerrit.libreoffice.org/409
Reviewed-by: Jean-Tiare Le Bigot <admin@jtlebi.fr>
Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz>
Tested-by: Tomáš Chvátal <tchvatal@suse.cz>
2012-08-14 10:23:24 +02:00
Bjoern Michaelsen 4e15809a78 add ./logerrit resubmit
resubmit creates a new Change-Id for the current change and thus allow to submit
changes for review on release branches that were already reviewed on master.

Also hint advanced users to 'git review' which requires some more setup, but
should make things easier for regular users.

Getting this functionality into 'git review' would be likely help adoption too
-- and in python there is some sane errorchecking possible.

Change-Id: Ibea6bbfe747af160728b838c6ee236fd8f89671d
2012-07-31 18:47:54 +02:00
Bjoern Michaelsen 689defb4ad check for uncommited work before executing a nextchange
Change-Id: I12b03bb778da712cfe48543949d9634be5221419
2012-07-10 13:33:05 +02:00
Miklos Vajna 2fab1a73b1 logerrit: for review, we need to grep for revision, not ref
Change-Id: I0fb8b1e4f14e153adae7a2ec1b3adbb0dab5c847
2012-07-05 13:22:47 +02:00
Bjoern Michaelsen f3b1a15813 fix ./logerrit review
* ./logerrit review did not resolve the ChangeId to a SHA
 * ./logerrit did still echo the command instead of executing it.

Change-Id: Ie4f8630f7a83134d6eb7992f4a61b5d3faf7e138
2012-07-05 13:15:34 +02:00
Miklos Vajna 616ad0b94c logerrit review: fix missing escaping, codereview -> code-review
Change-Id: Icf5facbb59cba2116ae3fc6bdfc035673cf47985
2012-06-29 10:00:47 +02:00
Bjoern Michaelsen b0cb1955da do not submit a change for now as that removes the ref on gerrit
Change-Id: I699aad760823a8ccbfc7dc93bf0658b5222dff71
2012-06-26 18:45:02 +02:00
Bjoern Michaelsen fe49f23529 add helper script for gerrit CLI integration
Change-Id: I5705530ee4d5b93bc66ca23463098ac45f49323d
2012-06-21 17:51:19 +02:00