git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 01/14] pull: implement fetch + merge

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 18, 2015, 15:55 UTC
Message-ID
<8fdf250d93dc34505fc77f01b415a43b@www.dscho.org>
In-Reply-To
<1431961571-20370-2-git-send-email-pyokagan@gmail.com>
Hi Paul,
On 2015-05-18 17:05, Paul Tan wrote:
Show 79 quoted lines
> Start off the rewrite of git-pull.sh to C by implementing a simple
> git-pull builtin that:
> 
> 1. Parses the command line arguments into [<repo> [<refspecs>...]]
> 
> 2. Runs git-fetch, passing the repo and refspecs to it.
> 
> 3. Runs git-merge FETCH_HEAD.
> 
> Due to missing features, several tests are disabled:
> 
> * Passing flags to git fetch, rebase, merge:
> 
>   * t5521: verbosity flags -v, -s
> 
> * Passing flags to git-merge, git-rebase:
> 
>   * t5150, t5572: Pass --ff, --no-ff, --ff-only to git-merge
> 
>   * t5520, t5521, t7406: Support --rebase, branch.*.rebase and
>     pull.rebase config
> 
>   * t6029, t4013: -s/--strategy
> 
>   * t6037: -X/--strategy-option
> 
>   * t5524: --log
> 
> * Passing flags to git-fetch:
> 
>   * t5521: --dry-run
> 
>   * t5500: --depth
> 
>   * t5521: --force
> 
>   * t5521: --all
> 
>   * t7403: --no-recurse-submodules
> 
> * t7601: pull.ff config sets --ff, --no-ff, --ff-only
> 
> * t5520: branch.*.rebase or pull.rebase sets --rebase, --rebase=preserve
> 
> * t5520: Pulling into void
> 
> * t5520: appropriate user-friendly error messages on no merge candidates
>   case
> 
> * t5520: appropriate user-friendly error messages if index has
>   unresolved entries.
> 
> * t5520: fast-forward working tree if branch head is updated by
>   git-fetch
> 
> * t5520: set reflog action to "pull args..."
> 
> These features will be re-implemented in succeeding patches.
> 
> Signed-off-by: Paul Tan <pyokagan@gmail.com>
> ---
>  Makefile                     |   2 +-
>  builtin.h                    |   1 +
>  builtin/pull.c               |  83 +++++++++++
>  contrib/examples/git-pull.sh | 339 +++++++++++++++++++++++++++++++++++++++++++
>  git-pull.sh                  | 339 -------------------------------------------
>  git.c                        |   1 +
>  t/t4013-diff-various.sh      |   3 +
>  t/t5150-request-pull.sh      |   2 +-
>  t/t5500-fetch-pack.sh        |  10 +-
>  t/t5520-pull.sh              |  68 ++++-----
>  t/t5521-pull-options.sh      |  20 +--
>  t/t5524-pull-msg.sh          |   2 +-
>  t/t5572-pull-submodule.sh    |   4 +
>  t/t6029-merge-subtree.sh     |   6 +-
>  t/t6037-merge-ours-theirs.sh |   2 +-
>  t/t7403-submodule-sync.sh    |   8 +-
>  t/t7406-submodule-update.sh  |   2 +
>  t/t7601-merge-pull-config.sh |   4 +-
This is an excellent way to develop the patch series. For the final patch series, I would like to propose that `git-pull.sh` is replaced by the builtin with the very last patch, though. That way, the builtin can be implemented in the way you did, but without touching the tests. In the final form, the builtin git-pull will be a drop-in replacement for the shell script, and the final patch will just make that switch.
In other words, patch 1/N would leave SCRIPT_SH in the Makefile untouched, and leave out the "pull" line from `git.c`.
Oh, by the way, if you pass the `-M` option to `git format-patch`, the diffstat will report the move rather than an added and a deleted git-pull.sh.

Ciao, Dscho

Previous: Paul TanNext: Paul Tan
Message 3 of 43 in “Make git-pull a builtin”
  1. 00/14 Make git-pull a builtinPaul Tan, May 18, 2015
  2. 01/14 pull: implement fetch + mergePaul Tan, May 18, 2015
  3. Johannes SchindelinMay 18, 2015
  4. 02/14 pull: pass verbosity, --progress flags to fetch and mergePaul Tan, May 18, 2015
  5. Johannes SchindelinMay 18, 2015
  6. Paul TanMay 21, 2015
  7. Johannes SchindelinMay 21, 2015
  8. Paul TanMay 22, 2015
  9. 03/14 pull: pass git-merge's options to git-mergePaul Tan, May 18, 2015
  10. 04/14 pull: pass git-fetch's options to git-fetchPaul Tan, May 18, 2015
  11. 05/14 pull: error on no merge candidatesPaul Tan, May 18, 2015
  12. Johannes SchindelinMay 18, 2015
  13. 06/14 pull: support pull.ff configPaul Tan, May 18, 2015
  14. Johannes SchindelinMay 18, 2015
  15. Paul TanMay 21, 2015
  16. 07/14 pull: check if in unresolved merge statePaul Tan, May 18, 2015
  17. Johannes SchindelinMay 18, 2015
  18. 08/14 pull: fast-forward working tree if head is updatedPaul Tan, May 18, 2015
  19. Johannes SchindelinMay 18, 2015
  20. 09/14 pull: implement pulling into an unborn branchPaul Tan, May 18, 2015
  21. 10/14 pull: set reflog messagePaul Tan, May 18, 2015
  22. Johannes SchindelinMay 18, 2015
  23. Junio C HamanoMay 18, 2015
  24. Paul TanMay 21, 2015
  25. 11/14 pull: teach git pull about --rebasePaul Tan, May 18, 2015
  26. Stefan BellerMay 18, 2015
  27. Johannes SchindelinMay 19, 2015
  28. Paul TanMay 31, 2015
  29. Paul TanJun 2, 2015
  30. 12/14 pull: configure --rebase via branch.<name>.rebase or pull.rebasePaul Tan, May 18, 2015
  31. Stefan BellerMay 18, 2015
  32. 13/14 pull --rebase: exit early when the working directory is dirtyPaul Tan, May 18, 2015
  33. 14/14 pull --rebase: error on no merge candidate casesPaul Tan, May 18, 2015
  34. Stefan BellerMay 19, 2015
  35. Johannes SchindelinMay 19, 2015
  36. Junio C HamanoMay 19, 2015
  37. Paul TanMay 22, 2015
  38. Johannes SchindelinMay 22, 2015
  39. Stefan BellerMay 22, 2015
  40. Junio C HamanoMay 18, 2015
  41. Paul TanMay 30, 2015
  42. Paul TanMay 30, 2015
  43. Johannes SchindelinMay 18, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.