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

Re: Fwd: Bug Report

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Mar 31, 2020, 07:26 UTC
Message-ID
<20200331072647.vprlkjczj5c7oo7p@yadavpratyush.com>
In-Reply-To
<CAJ+U58zvMCxuL6a8yfdNHCfsBkivybWxTioPU-p_PtekAAOWuA@mail.gmail.com>
Hi James,
On 30/03/20 09:18AM, James Yeoman wrote:
Show 60 quoted lines
> Hi, of course
> 
> === File at commit 1 ===
> import java.util.List;
> 
> public class Foo {
>     private int id;
>     private String name;
>     private List<Programme> programmes;
> 
>     public Foo() {
> 
>     }
> 
>     public Foo(int id, String name, List<Programme> programmes) {
>         this.id = id;
>         this.name = name;
>         this.programmes = programmes;
>     }
> 
>     // getters and setters
> }
> 
> === File in working area ===
> 
> import java.util.List;
> 
> public class Foo {
>     private int id;
>     private String name;
>     private List<Programme> programmes;
> 
>     public Foo() {
> 
>     }
> 
>     public Foo(int id, String name) {
>         this.id = id;
>         this.name = name;
>     }
> 
>     public Foo(int id, String name, List<Programme> programmes) {
>         this(id, name);
>         this.programmes = programmes;
>     }
> 
>     // getters and setters
> }
> 
> === diff with default ===
> -    public Foo(int id, String name, List<Programme> programmes) {
> +    public Foo(int id, String name) {
>          this.id = id;
>          this.name = name;
> +    }
> +
> +    public Foo(int id, String name, List<Programme> programmes) {
> +        this(id, name);
>          this.programmes = programmes;
>      }

I see this diff with both the default and patience algorithms on the command line tool.

I ran:
  $ git diff --diff-algorithm=default
and
  $ git diff --diff-algorithm=patience

Both yield the above diff. In fact, all 4 of "default", "patience", "minimal", and "histogram" yield the above diff. Which version of Git are you running? I am on v2.25.2.

PS: Please don't top post on the mailing list.
 
Show 38 quoted lines
> === diff with patience ===
>     public Foo(int id, String name) {
> +        this.id = id;
> +        this.name = name;
> +    }
> +
>      public Foo(int id, String name, List<Programme> programmes) {
> -        this.id = id;
> -        this.name = name;
> +        this(id, name);
>          this.programmes = programmes;
>      }
> 
> 
> On Fri, 27 Mar 2020 at 12:59, Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > Hi James,
> >
> > On 27/03/20 11:53AM, James Yeoman wrote:
> > > gitk and git-gui are both not respecting git config.
> > >
> > > When I set the diff.algorithm global config to patience, the command
> > > line git respects the config. However, both gitk and git-gui don't.
> > > When I use "git status -vv" to get a diff of the working directory,
> > > the diff produced respects the algorithm choice. The diff of the
> > > working directory in gitk and git-gui both still use the default diff
> > > algorithm, rather than the algorithm from the config.
> >
> > Thanks for reporting. Can you please send steps to produce a simple
> > scenario where the diff from two algorithms is different so I can test
> > why git-gui is not respecting the config. Make them as minimal as
> > possible.
> >
> > Also, +Cc Paul, the gitk maintainer.
> >
> > --
> > Regards,
> > Pratyush Yadav
-- 
Regards,
Pratyush Yadav
Previous: James Yeoman
Message 4 of 4 in “Bug Report”
  1. James YeomanMar 27, 2020
  2. Pratyush YadavMar 27, 2020
  3. Fwd: Bug ReportJames Yeoman, Mar 30, 2020
  4. Pratyush YadavMar 31, 2020

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.