threads / discuss / 43339

git UI nit

Subject: git UI nit

## tl;dr

8 messages between Dec 6, 2006 and Dec 6, 2006.

replies: 7people: 3as markdown or json

Han-Wen Nienhuys· Dec 6, 2006, 14:22 UTC · lore
When merging changes into a dirty working copy, one may get 
..
Updating 62a005d..7bbd698
Makefile: needs update
README: needs update
config.mak.in: needs update
configure.ac: needs update
fatal: Entry 'Makefile' not uptodate. Cannot merge.
..

This is bad error message; "uptodate" suggests that Makefile is too old. The problem is the reverse. The Makefile has been edited and hence it is 'newer'.

This message should say 
 Entry 'Makefile' is dirty. 
 Revert or commit changes before merging
-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
Johannes Schindelin· Dec 6, 2006, 14:46 UTC · re: Han-Wen Nienhuys · lore

Re: git UI nit

Hi,
On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
Show 16 quoted lines
> 
> When merging changes into a dirty working copy, one may get 
> 
> ..
> Updating 62a005d..7bbd698
> Makefile: needs update
> README: needs update
> config.mak.in: needs update
> configure.ac: needs update
> fatal: Entry 'Makefile' not uptodate. Cannot merge.
> ..
> 
> 
> This is bad error message; "uptodate" suggests that Makefile is too old. 
> The problem is the reverse.  The Makefile has been
> edited and hence it is 'newer'.  
Something like this?

-- snip -- [PATCH] Replace "needs update" by "dirty; needs commit"

This should clarify why a merge was not even started.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 read-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/read-cache.c b/read-cache.c
index eae4745..0d22de2 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -721,7 +721,7 @@ int refresh_cache(unsigned int flags)
 			}
 			if (quiet)
 				continue;
-			printf("%s: needs update\n", ce->name);
+			printf("%s: dirty; needs commit\n", ce->name);
 			has_errors = 1;
 			continue;
Han-Wen Nienhuys· Dec 6, 2006, 15:09 UTC · re: Johannes Schindelin · lore

Re: git UI nit

Johannes Schindelin escreveu:
Show 5 quoted lines
>  			}
>  			if (quiet)
>  				continue;
> -			printf("%s: needs update\n", ce->name);
> +			printf("%s: dirty; needs commit\n", ce->name);
Yes - I'd just mention revert as an option too. 
 
Johannes Schindelin· Dec 6, 2006, 15:20 UTC · re: Han-Wen Nienhuys · lore

Re: git UI nit

Hi,
On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
Show 8 quoted lines
> Johannes Schindelin escreveu:
> >  			}
> >  			if (quiet)
> >  				continue;
> > -			printf("%s: needs update\n", ce->name);
> > +			printf("%s: dirty; needs commit\n", ce->name);
> 
> Yes - I'd just mention revert as an option too. 
Actually, I like it that short.

We had an email on this list, where the poster said he could not merge with Git. It turned out that the merge failed with conflicts, but he did not bother reading through the messages, apparently because they were too many.

Ciao, Dscho

Jakub Narebski· Dec 6, 2006, 15:36 UTC · re: Johannes Schindelin · lore

Re: git UI nit

Johannes Schindelin wrote:
Show 12 quoted lines
> On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
> 
>> Johannes Schindelin escreveu:
>>>                     }
>>>                     if (quiet)
>>>                             continue;
>>> -                   printf("%s: needs update\n", ce->name);
>>> +                   printf("%s: dirty; needs commit\n", ce->name);
>> 
>> Yes - I'd just mention revert as an option too. 
> 
> Actually, I like it that short.
So why not simply use "%s: dirty\n"?
 
> We had an email on this list, where the poster said he could not merge 
> with Git. It turned out that the merge failed with conflicts, but he 
> did not bother reading through the messages, apparently because they were 
> too many.

Some of that stems from the "pipeline" model / implementation of git commands, where every separate stage spews it's own warning and error messages.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Han-Wen Nienhuys· Dec 6, 2006, 16:04 UTC · re: Jakub Narebski · lore

Re: git UI nit

Jakub Narebski escreveu:
Show 14 quoted lines
> Johannes Schindelin wrote:
> 
>> On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
>>
>>> Johannes Schindelin escreveu:
>>>>                     }
>>>>                     if (quiet)
>>>>                             continue;
>>>> -                   printf("%s: needs update\n", ce->name);
>>>> +                   printf("%s: dirty; needs commit\n", ce->name);
>>> Yes - I'd just mention revert as an option too. 
>> Actually, I like it that short.
> 
> So why not simply use "%s: dirty\n"?
because a newbie doesn't know how to resolve that problem.
-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
Jakub Narebski· Dec 6, 2006, 16:23 UTC · re: Han-Wen Nienhuys · lore

Re: git UI nit

Han-Wen Nienhuys wrote:
Show 17 quoted lines
> Jakub Narebski escreveu:
>> Johannes Schindelin wrote:
>> 
>>> On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
>>>
>>>> Johannes Schindelin escreveu:
>>>>>                     }
>>>>>                     if (quiet)
>>>>>                             continue;
>>>>> -                   printf("%s: needs update\n", ce->name);
>>>>> +                   printf("%s: dirty; needs commit\n", ce->name);
>>>> Yes - I'd just mention revert as an option too. 
>>> Actually, I like it that short.
>> 
>> So why not simply use "%s: dirty\n"?
> 
> because a newbie doesn't know how to resolve that problem.

But there are [at least] two ways to resolve this: commit or revert (reset).

-- 
Jakub Narebski
Han-Wen Nienhuys· Dec 6, 2006, 15:41 UTC · re: Johannes Schindelin · lore

Re: git UI nit

Johannes Schindelin escreveu:
Show 6 quoted lines
> Actually, I like it that short.
> 
> We had an email on this list, where the poster said he could not merge 
> with Git. It turned out that the merge failed with conflicts, but he 
> did not bother reading through the messages, apparently because they were 
> too many.
good point.

← back to recent threads