Skip to content

ff-refs: builtin command to fast-forward local refs

Michael Rappazzo git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ff-refs: builtin cmd to check and fast forward local refs to their upstream.gitignore Makefile builtin.h +3 more+226 -00 replies
2/5ff-refs: update each updatable refbuiltin/ff-refs.c+40 -00 replies
3/5ff-refs: add --dry-run and --skip-worktree optionsbuiltin/ff-refs.c+13 -20 replies
4/5ff-refs: Add documentationDocumentation/git-ff-refs.txt+55 -00 replies
5/5ff-refs: Add testst/t7900-ff-refs.sh+164 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] ff-refs: builtin command to fast-forward local refs

This patch series is built on (based on) 'next' because it relies on worktree.c

ff-refs will update local branches which can be fast-forwarded to their upstream tracking branch. Any branch which has diverged from the upstream will be left untouched by this command. Additionally, there are options for '--dry-run' and to '--skip-worktrees'.

There are two primary update mechanisms for fast-forwarding a branch.
- For a checked out branch, emulate git-merge --ff-only
- For a non-checked out branch, emulate git update-ref

When run on a repo with multiple worktrees (created with git-worktree add), git-ff-refs will take that into account when fast-forwarding. That is, it will run in 'merge --ff-only' emulation mode when a branch is checked out in a worktree, rather than in 'update-ref' mode.

The primary benefit of ff-refs will come for those who maintain several local branches which track upstream remote branches that update often. The intended usage pattern is to run git-fetch followed by git-ff-refs.

Michael Rappazzo (5):
ff-refs: builtin cmd to check and fast forward local refs to their
upstream
ff-refs: update each updatable ref
ff-refs: add --dry-run and --skip-worktree options
ff-refs: Add documentation
ff-refs: Add tests

 .gitignore                    |   1 +
 Documentation/git-ff-refs.txt |  55 +++++++++
 Makefile                      |   1 +
 builtin.h                     |   1 +
 builtin/ff-refs.c             | 272 ++++++++++++++++++++++++++++++++++++++++++
 command-list.txt              |   1 +
 git.c                         |   1 +
 t/t7900-ff-refs.sh            | 164 +++++++++++++++++++++++++
 8 files changed, 496 insertions(+)
 create mode 100644 Documentation/git-ff-refs.txt
 create mode 100644 builtin/ff-refs.c
 create mode 100755 t/t7900-ff-refs.sh
Signature · 1 line
2.6.2