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

Re: [PATCH 1/2] pull: handle git-fetch's options as well

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 18, 2015, 14:37 UTC
Message-ID
<1a102d8dabff79207c0d7e3bf434bd6f@www.dscho.org>
In-Reply-To
<1431955855-16228-1-git-send-email-pyokagan@gmail.com>
Hi Paul,
On 2015-05-18 15:30, Paul Tan wrote:
Show 30 quoted lines
> t5520: failing test for pull --all with no configured upstream
> t5521: test pull --all --dry-run does not make any changes
> 
> error_on_no_merge_candidates() does not consider the case where "$#"
> includes command-line flags that are passed to git-fetch.
> 
> As such, when the current branch has no configured upstream, and there
> are no merge candidates because of that, git-pull --all erroneously reports
> that we are pulling from "--all", as it believes that the first argument
> is the remote name.
> 
> Add a failing test that shows this case.
> 
> Signed-off-by: Paul Tan <pyokagan@gmail.com>
> ---
>  git-pull.sh             | 34 ++++++++++++++++++++++++++++++++--
>  t/t5520-pull.sh         | 20 ++++++++++++++++++++
>  t/t5521-pull-options.sh | 14 ++++++++++++++
>  3 files changed, 66 insertions(+), 2 deletions(-)
> 
> diff --git a/git-pull.sh b/git-pull.sh
> index 9ed01fd..28d49ab 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -163,11 +163,39 @@ do
>  	--d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
>  		dry_run=--dry-run
>  		;;
> +	--all|--no-all)
> +		all=$1 ;;
I *think* you also want to add a corresponding "all=" line just below the "dry_run=" line, to ensure that "all=blablabla git pull" does not interfere with this command-line setting.
The patch looks fine to me, otherwise.

Ciao, Dscho

Previous: Paul TanNext: Paul Tan
Message 4 of 6 in “pull: handle git-fetch's options as well”
  1. 1/2 pull: handle git-fetch's options as wellPaul Tan, May 18, 2015
  2. 2/2 work in progressPaul Tan, May 18, 2015
  3. Paul TanMay 18, 2015
  4. Johannes SchindelinMay 18, 2015
  5. Paul TanMay 21, 2015
  6. Paul TanMay 21, 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.