bug-libunistring
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-libunistring] two ways to use submodules for gnulib


From: Paolo Bonzini
Subject: [bug-libunistring] two ways to use submodules for gnulib
Date: Wed, 29 Apr 2009 14:36:47 +0200
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Another problem: can you please switch to submodules for gnulib?
Otherwise it's not clear which version of gnulib is associated to which
libunistring version.  For a library that is so tied to gnulib, this is
very important.

This is very simple (too bad it's too late to do this for 0.9):

  # The URL can be local, ssh:// or git://
  git submodule add URL-OF-GNULIB.GIT gnulib
  cat > .gitmodules <<-EOF
  [submodule "gnulib"]
  path = gnulib
  url = git://git.sv.gnu.org/gnulib.git
  EOF
  git add .gitmodules
  git commit -m'add gnulib as a submodule' -a

When you want to update libunistring's gnulib SHA1, you just run "cd
gnulib; git pull" and then commit the result.

---

If you do not want to do this, an alternative workflow is to only add
the submodule in a branch "releases" and tag from it.

To create the branch, use

  # Same as above, but in a different branch based off libunistring 0.9
  git checkout -b releases v0.9
  git submodule add URL-OF-GNULIB.GIT gnulib
  cat > .gitmodules <<-EOF
  [submodule "gnulib"]
  path = gnulib
  url = git://git.sv.gnu.org/gnulib.git
  EOF
  git add .gitmodules

  # Rewind to actual sha1 used for v0.9
  cd gnulib
  git checkout SHA1-USED-FOR-LIBUNISTRING-0.9
  cd ..

  # Create branch and retag
  git commit -m'create releases branch' -a
  git tag -s -m'libunistring 0.9 release (with gnulib submodule)'
v0.9-gnulib

  # Go back to current gnulib and to master branch
  cd gnulib
  git checkout master
  cd ..
  git checkout master

Then, when you release, you do the following:

  git checkout releases
  git reset --hard master
  git merge -s ours --no-commit address@hidden
  git submodule add URL-OF-GNULIB.GIT gnulib
  git show address@hidden:.gitmodules > .gitmodules
  git add .gitmodules
  git commit -m'add gnulib as a submodule before tagging' -a
  git tag -s -m'libunistring 0.10 release' v0.10
  git checkout master

This creates a commit that:

1) has master and the last release as a parent

2) is a snapshot of master but also includes the .gitmodules file and
the actual submodule

This commit is then used to create the tag.

Thanks!

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]