From 9a18e37fb9f2bef7a07a26ededc9226e7011963e Mon Sep 17 00:00:00 2001
From: Gavin Mak
Date: Wed, 27 Jan 2021 23:39:49 +0000
Subject: [PATCH] Add documentation for --inject_current
This change adds documentation and demos missing for the flag
--inject_current used in git new-branch.
Bug: 1167943
Change-Id: Id6305b876ade2c47eb7435a5edd055ae4fe2f323
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2648615
Reviewed-by: Josip Sokcevic
Commit-Queue: Gavin Mak
---
man/html/git-new-branch.html | 39 +++++++++++++++++++++++++++++---
man/man1/git-new-branch.1 | 30 +++++++++++++++++++++++-
man/src/git-new-branch.demo.1.sh | 3 +++
man/src/git-new-branch.txt | 12 +++++++++-
4 files changed, 79 insertions(+), 5 deletions(-)
diff --git a/man/html/git-new-branch.html b/man/html/git-new-branch.html
index 3c3b154b1..7bb3cc1d2 100644
--- a/man/html/git-new-branch.html
+++ b/man/html/git-new-branch.html
@@ -758,7 +758,8 @@ git-new-branch(1) Manual Page
git new-branch <branch_name>
git new-branch --upstream_current <branch_name>
git new-branch --upstream <REF> <branch_name>
-git new-branch --lkgr <branch_name>
+git new-branch --lkgr <branch_name>
+git new-branch --inject_current<branch_name>
@@ -807,6 +808,22 @@ new-branch --upstream_current <branch_name>.
+--inject_current
+
+
+
+ Set the tracking (upstream) branch of the newly-created branch to the
+ tracking (upstream) branch of the currently-checked-out branch and set the
+ tracking (upstream) branch of the currently-checked-out branch to the
+ newly-created branch.
+
+
+ Before: current > upstream
+
+ After: current > new > upstream
+
+
+
<branch_name>
@@ -875,12 +892,28 @@ Your branch is ahead of 'origin/master' by 4 commits.
nested_cl
fixit [ ahead 2 ]
frozen_branch [ ahead 3 ]
+ independent_cl [ ahead 1 ]
+$ git checkout subfeature
+Switched to branch 'subfeature'
+Your branch and 'cool_feature' have diverged,
+and have 2 and 1 different commits each, respectively.
+ (use "git pull" to merge the remote branch into yours)
+$ git new-branch --inject_current injected_cl
+$ git map-branches -v
+origin/master
+ cool_feature [ ahead 4 ] <1>
+ cl_depends_on_cool_feature
+ injected_cl *
+ subfeature [ ahead 2 | behind 1 ]
+ nested_cl
+ fixit [ ahead 2 ]
+ frozen_branch [ ahead 3 ]
independent_cl [ ahead 1 ]
-
-Note that both branches are cyan because they are currently the same
+Note that these branches are cyan because they are currently the same
commit object. See git-map-branches(1) for more detail.
@@ -926,7 +959,7 @@ by checking out the