comparison doc/gnulib-tool.texi @ 12977:a8f8215a262d

gnulib-tool.texi: mention possibility of git submodule * doc/gnulib-tool.texi (VCS Issues): Add details about using git submodules. * doc/.gitignore: Ignore another generated file. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Mon, 08 Mar 2010 14:26:11 -0700
parents 85ed9679cfa7
children f4c566dd41a4
comparison
equal deleted inserted replaced
12976:85ed9679cfa7 12977:a8f8215a262d
576 In projects which customarily omit from their VCS all files that are 576 In projects which customarily omit from their VCS all files that are
577 generated from other source files, none of these files and directories 577 generated from other source files, none of these files and directories
578 are added into the VCS. The only file that must be added to the VCS 578 are added into the VCS. The only file that must be added to the VCS
579 is @file{gnulib-cache.m4} in the M4 macros directory. Also, the 579 is @file{gnulib-cache.m4} in the M4 macros directory. Also, the
580 script for restoring files not in the VCS, customarily called 580 script for restoring files not in the VCS, customarily called
581 @file{autogen.sh} or @file{bootstrap.sh}, will typically contain the 581 @file{autogen.sh} or @file{bootstrap}, will typically contain the
582 statement for restoring the omitted files: 582 statement for restoring the omitted files:
583 583
584 @smallexample 584 @smallexample
585 $ gnulib-tool --update 585 $ gnulib-tool --update
586 @end smallexample 586 @end smallexample
587 587
588 The @samp{--update} option operates much like the @samp{--import} option, 588 The @samp{--update} option operates much like the @samp{--import} option,
589 but it does not offer the possibility to change the way Gnulib is used. 589 but it does not offer the possibility to change the way Gnulib is used.
590 Also it does not report in the ChangeLogs the files that it had to add 590 Also it does not report in the ChangeLogs the files that it had to add
591 because they were missing. 591 because they were missing.
592
593 Gnulib includes the file @file{build-aux/bootstrap} to aid a developer
594 in using this setup. Furthermore, in projects that use git for
595 version control, it is possible to use a git submodule containing the
596 precise commit of the gnulib repository, so that each developer
597 running @file{bootstrap} will get the same version of all
598 gnulib-provided files. The location of the submodule can be chosen to
599 fit the package's needs; here's how to initially create the submodule
600 in the directory @file{.gnulib}:
601
602 @smallexample
603 $ dir=.gnulib
604 $ git submodule add -- git://git.sv.gnu.org/gnulib.git $dir
605 $ git config alias.syncsub "submodule foreach git pull origin master"
606 @end smallexample
607
608 @noindent
609 Thereafter, @file{bootstrap} can run this command to update the
610 submodule to the recorded checkout level:
611
612 @smallexample
613 git submodule update --init $dir
614 @end smallexample
615
616 @noindent
617 and a developer can use this sequence to update to a newer version of
618 gnulib:
619
620 @smallexample
621 $ git syncsub
622 $ git add $dir
623 $ ./bootstrap
624 @end smallexample
592 625
593 @item 626 @item
594 Some projects take a ``middle road'': they do commit Gnulib source 627 Some projects take a ``middle road'': they do commit Gnulib source
595 files as in the first approach, but they do not commit other derived 628 files as in the first approach, but they do not commit other derived
596 files, such as a @code{Makefile.in} generated by Automake. This 629 files, such as a @code{Makefile.in} generated by Automake. This