80 Commits
Author SHA1 Message Date
Noel Grandin 702de5e98b clone submodules shallow by default
which makes it vastly quicker and easier to get going with
these very large repos.

Change-Id: Ib1bb8e824a6a2228be13ab4379e7f5e660371cea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189002
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
2025-08-06 18:36:42 +02:00
Christian Lohmaier 13516716fa g: macOS' ln doesn't know --symbolic, only -s
Change-Id: Idf0b276563a2552db7c6a9f2cca14b55acabb753
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178316
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2024-12-11 17:52:26 +01:00
Christian Lohmaier caf0071d60 fix refreshing git-hooks when using git-bash
real symlinks require admin-rights or developer mode, and the other
fallback mechanisms won't work for the version of git that comes with
git-bash. Either spawning the process failes or worse it silently fails
and basically ignores the hook.
MSYS uses regular file copy when using "ln -s" which means to make sure
the current version of a hook is used the hooks need to replaced
everytime or the file contents need to be compared. When using hardlinks
instead it is enough to check whether the source and target share the
same inode.

Change-Id: Ib2e325048779828313afc7fc9d120661d55fc3a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177498
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-11-29 13:25:59 +01:00
Juergen Funk cd013e6671 git-hooks: remove hint in './g -z'
In the patch 05ea4ac195 the hint
is too mutch and the elsewhere I think it makes no sense, remove.

Change-Id: I1c13e593f673f2cab9a307f57f59efa1fbd903c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149761
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-01 13:28:14 +02:00
Andrea Gelmini c888ac3117 Fix typo
Change-Id: I65261e7aaccb640eee4100fd53bc7e7e2cb229f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149318
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2023-03-22 12:46:19 +00:00
Juergen Funk 05ea4ac195 git-hooks: better handling in './g -z' with win-links
and linux-links

This patch improve patch
9afc6b22e2 git-hooks:
  overwrite the windows-links not with linux-links

The main problem with the previous patch is that
when an alias is set for git, this alias will not
map in the Shell script passed, better you
use a git-symlink.

The other problem was the behavior of cygwin-bash
and win-git-bash that is not always the same, e.g.
   - winlnk=$(cmd /C ... 2>&1) it hang infinity,
      line 123
   - the 'ln' made not link, it only copy the files

Improving the FOR in ./git-hooks/README, when
you have the copied files, need a other del command

The patch can not set the windows-links, only output
the ./git-hooks/README
But in Win 11 should be possible, it is not needed
admin-rights for the 'mklink' command

Change-Id: Icecdb96e65fe2bba1270dfad2ac1af5af145925a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148462
Tested-by: Jenkins
Reviewed-by: Juergen Funk <juergen.funk_ml@cib.de>
2023-03-22 10:44:24 +00:00
Juergen Funk 9afc6b22e2 git-hooks: overwrite the windows-links not with linux-links
Always when you call build or logerrit, then the windows-links
overwrite with linux-links, but when you using GIT for Windows
you need the windows-links.
This patch made a check it is using GIT for Windows, and check what
for link it is, when wrong link, it output the .git-hooks/README

Improve the check for links, when a link is set not need to set
the link anymore

In .git-hooks/README improve the FOR with delete of the wrong link

look here for GIT for Windows:
https://wiki.documentfoundation.org/Development/BuildingOnWindows/de#Cygwin_and_git

Change-Id: I9f6ef9aca316058ef74cb2b2d107236f03a2e2ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147458
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-03-01 10:44:25 +00:00
Mike Kaganski 1fd42472e2 Avoid refreshing all hooks in secondary worktrees
This avoids "ln: failed to access '.git/hooks/foo': Not a directory"
console noise. The primary worktree's hooks are used in secondary
worktrees anyway.

Possibly using 'git rev-parse --git-dir', and putting hooks there
would be a better fix? No idea.

Change-Id: I846e065d017744e9d8dcee847d48bc1adc66d761
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143358
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-11-28 05:18:12 +01:00
Michael Stahl aa8ef74b47 g: we are not, in fact, in the BUILDDIR
For an out-of-tree build, "make fetch" poinlessly clones all git
submodules.

Change-Id: If4afb218946f49ba934f68b35806fd8143c39387
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135143
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-05-31 10:29:45 +02:00
Arnaud VERSINI 5448ad5703 Allow g to run git gc command
Change-Id: Ibca338cbd99839b20a2373075a2e544e7ab638e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127870
Tested-by: Jenkins
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
2022-01-15 15:42:34 +01:00
Kevin Suo 508ccbdb14 Add "--progress" agument to the ./g command
Newer version of git has a --progress option to show the progress when running "git submodule update". This is useful in our ./g command expecially when we are building the code with l10n languages enabled and the network connection is slow. Without this I do not see where I am for the update process and may think it have died.

Change-Id: I4c9e1e9bccbd8e6ca2ea2b44f5b6d6d90cad1506
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117922
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-07-12 10:55:05 +02:00
Mike Kaganski 0e6e10cd3d Workaround a problem in Git for Windows' bash
... where running './g pull -r' resulted in

  ln: failed to create symbolic link '.git/modules/dictionaries/hooks/*': No such file or directory
  ln: failed to create symbolic link '.git/modules/translations/hooks/*': No such file or directory

Change-Id: Ie0bd2eaca44f8b1a2ad2de9083bbefc779e213e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111948
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-04 15:16:55 +01:00
Thorsten Behrens 5fce97a58b ./g: don't exit early on ./g checkout -f
Change-Id: I33f54c365bce64ccccfeb1c58fc8e4faddb7ad77
Reviewed-on: https://gerrit.libreoffice.org/56822
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-02 23:51:08 +02:00
Thorsten Behrens 4c475bc676 ./g: indent & de-tabbify to make code readable
Change-Id: Ica2a0dd281f77bfab223fa1526ba0720c9c280f1
Reviewed-on: https://gerrit.libreoffice.org/56821
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-02 23:50:38 +02:00
Stephan Bergmann 3a33d9ce82 Revert "g: ignore submodule changes"
This reverts commit 27925032cd.
Conflicts:
	g

According to vmiklos, that commit was meant to help with the following scenario:
Assume a dev uses submodules and uses plain `git pull && git submodule update`
instead of ./g.  When they forget the "&& git submodule update" part and do
`git commit -a`, changes to the submodules were excluded from the commit.

However, when they do `git add -u && git commit` instead of `git commit -a`,
changes to the submodules /are/ included in the commit, despite `git status` or
`git diff` (both prior to `git add -u`) or `git diff --cached` (after `git add
-u`) not indicating that there are any changes to the submodules.  I consider
that problem more confusing and severe than the problem that the commit solved.

Change-Id: I595eed3c1c04efd108be1ccd792d8d7bce72a345
Reviewed-on: https://gerrit.libreoffice.org/51155
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-03-12 20:38:49 +01:00
Ilmari Lauhakangas e5b1c53744 tdf#105204: more ShellCheck nitpicks for g
Change-Id: I50cb1a403d3aa34434e61a2a995ef043b2f1f82c
SC2086: Double quote to prevent globbing and word splitting.
SC2145: Argument mixes string and array. Use * or separate argument.
Reviewed-on: https://gerrit.libreoffice.org/37023
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-04-27 12:22:25 +02:00
Ilmari Lauhakangas 55c5b27bd6 tdf#105204: ShellCheck nitpicks for g
Change-Id: I1814bc65c62af1a92a090127f1cfda8ad228936d
SC2002: Useless cat.
SC2045: Iterating over ls output is fragile.
SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
SC2006: Use $(..) instead of legacy `..`
Reviewed-on: https://gerrit.libreoffice.org/36571
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2017-04-26 20:22:07 +02:00
Christian Lohmaier d94b827c40 it is "git submodule", not "git submodules" 2016-05-17 14:29:39 +02:00
Juergen Funk 87495ce121 g: fix var in checkout
Change-Id: Ie414037671ca9248931a47000db2b4ed259e72da
Reviewed-on: https://gerrit.libreoffice.org/21217
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-08 12:13:02 +00:00
Tomofumi Yagi 125f06dbf7 'g' doesn't work correctly when config_host.mk contains non-ascii characters.
In 'g' shell script, we use grep to get substring from config_host.mk file.
When config_host.mk file contains non-ascii characters(e.g. Japanese),
this processing doesn't work.
As a result, some variables(SUBMODULES_CONFIGURED, REFERENCED_GIT, LINKED_GIT) will be
assigned to "Binary file (standard input) matches".
This is an error message of grep.
The problem will reproduce on Cygwin64 with Japanese locale.

With '-a' option, grep will work well, and 'g' shell script will work correctly.

Please refer the following commit,too.
http://cgit.freedesktop.org/libreoffice/core/commit/?id=0293ec98c92fd58a592f7dd86fbbf47e7b9195c6

Change-Id: If4e0b356173c8f442e3539ed343f441d87dbfd48
Reviewed-on: https://gerrit.libreoffice.org/16344
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2015-06-18 11:19:23 +00:00
Tomofumi Yagi 0293ec98c9 g: SRC_ROOT may not contain path string in a localized environment
When config_host.mk contains non-ascii characters(e.g. Japanese ),
SRC_ROOT may contain an error message "Binary file (standard input)
 matches") from grep, and SRC_ROOT may not contain path string.
With '-a' option, grep will work well.

Change-Id: Ifaada5f5a11939d624460cd8dcc57d93911ae790
Reviewed-on: https://gerrit.libreoffice.org/14491
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-02-17 13:26:12 +00:00
Stephan Bergmann a3e51e2706 Some quoting fixes
Change-Id: I3b375c67ed84f29360cbc9933f4a1e5c7cbe3277
2015-01-14 15:42:00 +01:00
Miklos Vajna 677b4402a9 g: fix --set-push-urls
1) submodule's .git is possibly a file now

2) just use the logerrit alias, as

   - logerrit setup already set that up
   - possibly otherwise the right ssh key is not picked up

Change-Id: I4fb355a7f7ec7d549d2b06367f4fd10d06086374
2013-10-04 16:06:02 +02:00
Miklos Vajna 27925032cd g: ignore submodule changes
Change-Id: I6125dd018615bc7aa18bacc838ea602ccb0fabc1
2013-07-22 12:13:20 +02:00
Lionel Elie Mamane aa1a988c74 Reintroduce --with-linked-git option
With slightly different semantics:
Instead of pointing at a previous checkout,
point at base directory of all repos.

Change-Id: I254ecc33071be53067c44610b030f737cf75a7ee
2013-06-21 13:36:33 +02:00
Miklos Vajna 73b50b7336 g clone: fix non-referenced cloning
Change-Id: I98d6f5c20bacbb5d6457857906c591fea034288a
2013-02-26 16:18:14 +01:00
Miklos Vajna 803137f471 configure: add --with-referenced-git option
This is similar to --with-linked-git, but:

1) It uses git submodule update --reference, so it works with submodules.

2) The created repo is a true git repo, except that its object database
reuses the referenced repo's objects, so it's a real speedup when e.g.
translations are enabled.

I intentionally didn't just fixed --with-linked-git, to make it clear
this is more like git clone --reference, not git-new-workdir.

Change-Id: I7c9584bce3670fd1e175b90aded2435cfe78056d
2013-02-09 19:21:53 +01:00
Norbert Thiebaud 0cac67b270 set-up the hooks for submodules for recent git setup
Change-Id: I52482d017966e1d9671f92f43ec9d8cac6daf602
2012-12-21 04:40:06 -06:00
Luboš Luňák d449869617 ./g cannot reference builddir
Because either it's called from there, and then it's the current directory,
or otherwise the srcdir has no idea where the builddir is (or even how many
of them), and there's nothing to tell it.

Change-Id: I88c5fe8f015cc63a5aa7c327eb82ed751c3e8aa0
2012-12-11 16:39:02 +01:00
Luboš Luňák c8c056fd20 BUILD_DIR -> BUILDDIR, to be consistent with the other *DIR
Change-Id: Ia80a1246a7e3c8862a50a3daf79aba5609b7df3a
2012-12-11 15:39:49 +01:00
Norbert Thiebaud ae4e327739 Prepare for read-only source build
This patch allows to do

mkdir <build_dir>
cd <build_dir>
<src_root>/autogen.sh
make

Only the remaining dmake modules are poluting the <src_root>...
which will get eventually convererd to gmake...

Change-Id: Iefd64732fa12e096d554cff4eee6b777deb92338
Reviewed-on: https://gerrit.libreoffice.org/1273
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-12-11 14:26:30 +00:00
Jan Holesovsky e1b59fc0c4 Fix --set-push-urls.
Change-Id: Ic3a424b5ac8c2168747bc7253f421bf5367beac7
2012-11-23 21:06:57 +01:00
Norbert Thiebaud 060219ac1a binfilter.die.die.die
Change-Id: Ia3c103e4343d309b997ed37e33a382ffdfbddac3
Reviewed-on: https://gerrit.libreoffice.org/1014
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
2012-11-09 07:58:02 +00:00
Miklos Vajna 2a8cabe86a g: fix typo
Change-Id: I97484d8647549646117f6c51dde4eb17ec82c8be
2012-10-18 09:27:52 +02:00
Peter Foley 41b5c80add cleanup ./g output
Change-Id: I84a775ceb983ad21d4585a3c3718f99bbac5a282
2012-10-16 20:46:22 -04:00
Norbert Thiebaud c58b4fcd35 missing fi in ./g
Change-Id: Ic763d7cd73c2a3df8e5d5146eaf795188d8c79d1
2012-10-16 11:28:27 -05:00
Norbert Thiebaud a31714fb75 add tag support to ./g, try to optimize pre->post submerge situation
Change-Id: I052817865da6df193c0451eccc3b8b6f507845a3
2012-10-16 11:28:27 -05:00
Norbert Thiebaud 2c5cdc4d3e when switching to a pre-submodule point, clean-up the soft-link point
Change-Id: I5a8f144bb4ad167cfa0e6763e3cf273b9127d65b
2012-10-16 11:28:26 -05:00
Norbert Thiebaud 9152c42a65 submodules migration
Change-Id: Ib3e472a4b1abf880f695be7a6667393d6a82f10d
2012-10-16 11:28:26 -05:00
Jan Holesovsky aa6808ba11 Update ./g --set-push-user to work with gerrit.
Change-Id: If83b29222740e9d479d8b3c9b9d90ccc3706cd49
2012-08-20 14:04:06 +02:00
Norbert Thiebaud 1659bbe429 suppress distracting message in ./g on some platform
we use perl to determine the absolute path of argument thought to be
fiels. but sometime they are not file at all and that call 'fail'.
The code is meant to deal with such case, but
on some platform that produce a scary message on stderr in the
middle of the build log.
This hide these messages.

Change-Id: I52d43e0b26847ab091d76fd446a05c4d84836a77
2012-07-21 07:21:11 -05:00
Bjoern Michaelsen 79e9a64299 make ./g robust against missing bin/repo-list file
Change-Id: Ib61a679221d0eddea61358024d31c90464dccefb
2012-07-10 19:09:56 +02:00
Miklos Vajna ae6d4aeb89 g push/status: use @{upstream} instead of origin
origin won't work if origin/HEAD points to nowhere, which is a valid
use-case.
2012-03-13 11:49:32 +01:00
Norbert Thiebaud a7069c2aa2 git rev-parse argument are not files, no need to try to find abs-path
This was causing some error message on Windows
2011-11-29 11:00:12 -06:00
Stephan Bergmann 79e65eefd9 Added ./g -v switch to show git commands. 2011-11-29 16:57:16 +01:00
Michael Stahl 175f17b31e 'g': whitespace: expand tabs 2011-11-04 10:54:59 +01:00
Michael Stahl a0eb50ac6c 'g': actually set up git hooks properly 2011-11-04 10:54:59 +01:00
Michael Meeks 2ed58be879 make --last-working checkout the last working version
thanks to Bjoern and Christian for tips.
2011-10-31 15:06:34 +00:00
Michael Meeks 8418eeb79b 'g' tool: fix silly error in --set-last-working 2011-10-27 12:54:47 +01:00
Michael Meeks 4d2803d706 initial cut at 'last working' feature to help windows builders 2011-10-25 16:25:27 +01:00