diff mbox series

[v3,1/2] git-gui: use existing interface to query a path's attribute

Message ID 97013a71289857767100d6a4adcb39ca99b2b21b.1569873171.git.bert.wesarg@googlemail.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/2] git-gui: use existing interface to query a path's attribute | expand

Commit Message

Bert Wesarg Sept. 30, 2019, 7:54 p.m. UTC
Replace the hand-coded call to git check-attr with the already provided one.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 lib/diff.tcl | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

Comments

Pratyush Yadav Oct. 1, 2019, 2:24 p.m. UTC | #1
Hi,

I don't see any difference between v3 and v2 of this patch. What changed 
in this version?

On 30/09/19 09:54PM, Bert Wesarg wrote:
> Replace the hand-coded call to git check-attr with the already provided one.
> 
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> ---
>  lib/diff.tcl | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/lib/diff.tcl b/lib/diff.tcl
> index 958a0fa..0fd4600 100644
> --- a/lib/diff.tcl
> +++ b/lib/diff.tcl
> @@ -270,19 +270,6 @@ proc show_other_diff {path w m cont_info} {
>  	}
>  }
>  
> -proc get_conflict_marker_size {path} {
> -	set size 7
> -	catch {
> -		set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]]
> -		set ret [gets $fd_rc line]
> -		close $fd_rc
> -		if {$ret > 0} {
> -			regexp {.*: conflict-marker-size: (\d+)$} $line line size
> -		}
> -	}
> -	return $size
> -}
> -
>  proc start_show_diff {cont_info {add_opts {}}} {
>  	global file_states file_lists
>  	global is_3way_diff is_submodule_diff diff_active repo_config
> @@ -298,7 +285,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
>  	set is_submodule_diff 0
>  	set diff_active 1
>  	set current_diff_header {}
> -	set conflict_size [get_conflict_marker_size $path]
> +	set conflict_size [gitattr $path conflict-marker-size 7]
>  
>  	set cmd [list]
>  	if {$w eq $ui_index} {
> -- 
> 2.23.0.11.g242cf7f110
>
Bert Wesarg Oct. 1, 2019, 3:22 p.m. UTC | #2
On Tue, Oct 1, 2019 at 4:24 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> Hi,
>
> I don't see any difference between v3 and v2 of this patch. What changed
> in this version?

nothing, but 2/2 changed.

Bert

>
> On 30/09/19 09:54PM, Bert Wesarg wrote:
> > Replace the hand-coded call to git check-attr with the already provided one.
> >
> > Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
> > ---
> >  lib/diff.tcl | 15 +--------------
> >  1 file changed, 1 insertion(+), 14 deletions(-)
> >
> > diff --git a/lib/diff.tcl b/lib/diff.tcl
> > index 958a0fa..0fd4600 100644
> > --- a/lib/diff.tcl
> > +++ b/lib/diff.tcl
> > @@ -270,19 +270,6 @@ proc show_other_diff {path w m cont_info} {
> >       }
> >  }
> >
> > -proc get_conflict_marker_size {path} {
> > -     set size 7
> > -     catch {
> > -             set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]]
> > -             set ret [gets $fd_rc line]
> > -             close $fd_rc
> > -             if {$ret > 0} {
> > -                     regexp {.*: conflict-marker-size: (\d+)$} $line line size
> > -             }
> > -     }
> > -     return $size
> > -}
> > -
> >  proc start_show_diff {cont_info {add_opts {}}} {
> >       global file_states file_lists
> >       global is_3way_diff is_submodule_diff diff_active repo_config
> > @@ -298,7 +285,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
> >       set is_submodule_diff 0
> >       set diff_active 1
> >       set current_diff_header {}
> > -     set conflict_size [get_conflict_marker_size $path]
> > +     set conflict_size [gitattr $path conflict-marker-size 7]
> >
> >       set cmd [list]
> >       if {$w eq $ui_index} {
> > --
> > 2.23.0.11.g242cf7f110
> >
>
> --
> Regards,
> Pratyush Yadav
Pratyush Yadav Oct. 1, 2019, 5:31 p.m. UTC | #3
On 01/10/19 05:22PM, Bert Wesarg wrote:
> On Tue, Oct 1, 2019 at 4:24 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> >
> > Hi,
> >
> > I don't see any difference between v3 and v2 of this patch. What changed
> > in this version?
> 
> nothing, but 2/2 changed.

I don't see a v3 of 2/2 in my inbox. A search on public-inbox yields 
nothing either. Can you please check if the patch was sent properly? Or 
if you _can_ find it on public-inbox.org, a link to that would do just 
fine.

I _do_ have v2 of both patches, but the v3 of the second patch is the 
one missing.
Bert Wesarg Oct. 2, 2019, 7:35 a.m. UTC | #4
Pratyush,

On Tue, Oct 1, 2019 at 7:31 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
>
> On 01/10/19 05:22PM, Bert Wesarg wrote:
> > On Tue, Oct 1, 2019 at 4:24 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > >
> > > Hi,
> > >
> > > I don't see any difference between v3 and v2 of this patch. What changed
> > > in this version?
> >
> > nothing, but 2/2 changed.
>
> I don't see a v3 of 2/2 in my inbox. A search on public-inbox yields
> nothing either. Can you please check if the patch was sent properly? Or
> if you _can_ find it on public-inbox.org, a link to that would do just
> fine.
>
> I _do_ have v2 of both patches, but the v3 of the second patch is the
> one missing.

I noticed this already, while in contact with Johannes on GitHub and I
found my error. While pasting messages ids for References into the v3
patch, I missed to renamed Message-Id to References for the v2 patch,
thus the v3 has the same Message-Id than the v2 patch. Will resend
now.

Bert

>
> --
> Regards,
> Pratyush Yadav
diff mbox series

Patch

diff --git a/lib/diff.tcl b/lib/diff.tcl
index 958a0fa..0fd4600 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -270,19 +270,6 @@  proc show_other_diff {path w m cont_info} {
 	}
 }
 
-proc get_conflict_marker_size {path} {
-	set size 7
-	catch {
-		set fd_rc [eval [list git_read check-attr "conflict-marker-size" -- $path]]
-		set ret [gets $fd_rc line]
-		close $fd_rc
-		if {$ret > 0} {
-			regexp {.*: conflict-marker-size: (\d+)$} $line line size
-		}
-	}
-	return $size
-}
-
 proc start_show_diff {cont_info {add_opts {}}} {
 	global file_states file_lists
 	global is_3way_diff is_submodule_diff diff_active repo_config
@@ -298,7 +285,7 @@  proc start_show_diff {cont_info {add_opts {}}} {
 	set is_submodule_diff 0
 	set diff_active 1
 	set current_diff_header {}
-	set conflict_size [get_conflict_marker_size $path]
+	set conflict_size [gitattr $path conflict-marker-size 7]
 
 	set cmd [list]
 	if {$w eq $ui_index} {