From 3b5c2e55e6c9d783a1d8c61ef7ee9ddd3ea5d72e Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 10 Apr 2014 15:23:09 +0300 Subject: [PATCH] devel: implement --retain-history option With this option defined gbs tries to preserve the history of the changes (since upstream) doing a convert. Basically, for each commit in the old branch a corresponding commit in the new orphan packaging branch is created. This works by dumping packaging files and updating patches for each commit. However, empty commits are not generated - these are caused e.g. by changes files that are ignored by patch-generation like .gbs.conf. NOTE! Only valid for the 'convert' action. Change-Id: I669fa6732bea7940561f5c99820d6d97d14b0658 Signed-off-by: Markus Lehtonen --- gitbuildsys/cmd_devel.py | 2 ++ tools/gbs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/gitbuildsys/cmd_devel.py b/gitbuildsys/cmd_devel.py index 09d1913..db5c5d7 100644 --- a/gitbuildsys/cmd_devel.py +++ b/gitbuildsys/cmd_devel.py @@ -56,6 +56,8 @@ def compose_gbp_args(repo, tmp_dir, spec, args): "--patch-export-ignore-path=^(%s/.*|.gbs.conf)" % packaging_dir] if args.debug: argv.append("--verbose") + if args.retain_history: + argv.append("--retain-history") return argv diff --git a/tools/gbs b/tools/gbs index 32c0c55..f4010f0 100755 --- a/tools/gbs +++ b/tools/gbs @@ -507,6 +507,10 @@ def devel_parser(parser): help="upstream tag format, '${upstreamversion}' is " 'expanded to the version in the spec file. ' "E.g. 'v${upstreamversion}'") + parser.add_argument('--retain-history', action='store_true', + help='Preserve as much of the git history as possible ' + 'in the conversion, i.e. create one commit per commit. ' + 'Only relevant for the convert action.') parser.add_argument('action', choices=['start', 'export', 'drop', 'switch', 'convert'], help='Action to take') -- 2.7.4