threads / patch / 43480

patchRE: [PATCH] git-explain

Subject: RE: [PATCH] git-explain

## tl;dr

7 messages between Dec 5, 2006 and Dec 5, 2006. Diffs are folded; open one to read it.

replies: 6people: 6as markdown or json

Nicolas Pitre· Dec 5, 2006, 03:55 UTC · lore

Re: [PATCH] git-explain

On Mon, 4 Dec 2006, Junio C Hamano wrote:
Show 5 quoted lines
> [PATCH] git-explain
> 
> This patch adds "git-explain" script that notices various clues
> other commands can leave the working tree and repository in and
> intended to guide the end user out of the confused mess.
What about calling it git-whatsup instead?
J. Bruce Fields· Dec 5, 2006, 03:57 UTC · re: Nicolas Pitre · lore

Re: [PATCH] git-explain

On Mon, Dec 04, 2006 at 10:55:49PM -0500, Nicolas Pitre wrote:
Show 9 quoted lines
> On Mon, 4 Dec 2006, Junio C Hamano wrote:
> 
> > [PATCH] git-explain
> > 
> > This patch adds "git-explain" script that notices various clues
> > other commands can leave the working tree and repository in and
> > intended to guide the end user out of the confused mess.
> 
> What about calling it git-whatsup instead?
No, clearly it should be git-wtf.
Junio C Hamano· Dec 5, 2006, 06:09 UTC · re: J. Bruce Fields · lore

Re: [PATCH] git-explain

"J. Bruce Fields" <bfields@fieldses.org> writes:
Show 8 quoted lines
> On Mon, Dec 04, 2006 at 10:55:49PM -0500, Nicolas Pitre wrote:
>> ...
>> > [PATCH] git-explain
>> > ...
>> 
>> What about calling it git-whatsup instead?
>
> No, clearly it should be git-wtf.

Should I take these responses to mean that you two are negative about the approach of spending extra cycles to commands that can leave the working tree in a "in the middle of doing something" state to help having a unified command to explain what the situation is and suggest the user possible exits, or are you saying that it might be a good idea but "git explain" is a bad name?

An issue with this approach is that this can be the beginning of hardwiring the official "right way of doing things" in the set of tools. Pursuing this approach would enhance the set of state markers like "FAILED_MERGE" in the example, which means:

 - more commands would actively record what they were attempting
   to do, obviously;
 - over time "git explain" will learn about these state markers,
   and we would hardwire the "best current practice" exits from
   various states in the help messages;
 - also commands other than "git explain" would learn about the
   state markers of other commands, and change their behaviour.
   For example, "git am" might learn to refuse running while a
   merge in progress much earlier than with the current
   implementation.
The last point can easily become a double-edged sword.

Hardwiring the recommended workflow in the tools would reduce chances of mistakes, but it could rob the flexibility from them if we are not careful and forget to take into account some useful combination of tools when adding such safety valves.

Jeff King· Dec 5, 2006, 07:26 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-explain

On Mon, Dec 04, 2006 at 10:09:17PM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> Should I take these responses to mean that you two are negative
> about the approach of spending extra cycles to commands that can
> leave the working tree in a "in the middle of doing something"
> state to help having a unified command to explain what the
> situation is and suggest the user possible exits, or are you
> saying that it might be a good idea but "git explain" is a bad
> name?

It seems like the point of this command is to show some state information which would otherwise be hard to see. I think of 'git status' as the way to look at the repository state. Perhaps we should enhance the output of 'git status' to note things such as failed merges, whether we're bisecting, in the middle of applying a patch series, etc. There could be an optional verbosity switch to give "full explanations" including recommended ways to deal with the situation.

> Hardwiring the recommended workflow in the tools would reduce
> chances of mistakes, but it could rob the flexibility from them
> if we are not careful and forget to take into account some
> useful combination of tools when adding such safety valves.

As long as the safety valves don't come up _routinely_ in certain workflows, it seems OK to bypass them with a '-f' force switch. I suspect the best way to figure out if such workflows are in use is to put in the safety valves and see who complains; otherwise we're stuck with brainstorming workflows and deciding whether they make sense.

Johannes Schindelin· Dec 5, 2006, 08:58 UTC · re: Junio C Hamano · lore

Re: [PATCH] git-explain

Hi,
On Mon, 4 Dec 2006, Junio C Hamano wrote:
Show 13 quoted lines
> "J. Bruce Fields" <bfields@fieldses.org> writes:
> 
> > On Mon, Dec 04, 2006 at 10:55:49PM -0500, Nicolas Pitre wrote:
> >> ...
> >> > [PATCH] git-explain
> >> > ...
> >> 
> >> What about calling it git-whatsup instead?
> >
> > No, clearly it should be git-wtf.
> 
> Should I take these responses to mean that you two are negative
> about the approach [...]

I think they just were in the mood for some slashdot style unimportant-aspects-in-a-funny-way discussion.

Show 7 quoted lines
> An issue with this approach is that this can be the beginning of
> hardwiring the official "right way of doing things" in the set
> of tools.  Pursuing this approach would enhance the set of state
> markers like "FAILED_MERGE" in the example, which means:
> 
>  - more commands would actively record what they were attempting
>    to do, obviously;
... which is a good thing.
>  - over time "git explain" will learn about these state markers,
>    and we would hardwire the "best current practice" exits from
>    various states in the help messages;
... which is also a good thing.
Show 5 quoted lines
>  - also commands other than "git explain" would learn about the
>    state markers of other commands, and change their behaviour.
>    For example, "git am" might learn to refuse running while a
>    merge in progress much earlier than with the current
>    implementation.
If the other commands are outside of git, it will be a problem.
> The last point [git-am refusing to run during a merge] can easily become 
> a double-edged sword.
This particular behaviour seems like a good thing, too!
> Hardwiring the recommended workflow in the tools would reduce chances of 
> mistakes, but it could rob the flexibility from them if we are not 
> careful and forget to take into account some useful combination of tools 
> when adding such safety valves.

As has been the case not at all long ago, a saftey valve which no longer made sense was just removed.

As for the inflexibility of a recommended workflow: by now, long-time gitsters have had enough time to fiddle around with git and to develop a workflow which Just Works. It is just a nice gesture of old-time users towards new-time users to pass that knowledge. And new-time users are often not in the least interested in learning the ropes the hard way.

Besides, the recommended workflow(s) can be changed/replaced by other porcelainish commands, because only those will contain the safety valves, right?

Ciao, Dscho

J. Bruce Fields· Dec 5, 2006, 21:00 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git-explain

On Tue, Dec 05, 2006 at 09:58:25AM +0100, Johannes Schindelin wrote:
Show 17 quoted lines
> On Mon, 4 Dec 2006, Junio C Hamano wrote:
> > "J. Bruce Fields" <bfields@fieldses.org> writes:
> > 
> > > On Mon, Dec 04, 2006 at 10:55:49PM -0500, Nicolas Pitre wrote:
> > >> ...
> > >> > [PATCH] git-explain
> > >> > ...
> > >> 
> > >> What about calling it git-whatsup instead?
> > >
> > > No, clearly it should be git-wtf.
> > 
> > Should I take these responses to mean that you two are negative
> > about the approach [...]
> 
> I think they just were in the mood for some slashdot style 
> unimportant-aspects-in-a-funny-way discussion.
Yeah, I was just being silly, apologies.
Raimund Bauer· Dec 5, 2006, 09:11 UTC · re: Junio C Hamano · lore
> An issue with this approach is that this can be the beginning 
> of hardwiring the official "right way of doing things" in the 
> set of tools.  Pursuing this approach would enhance the set 
> of state markers like "FAILED_MERGE" in the example, which means:

Wouldn't it be better to create some kind of action-log (that's cleared at the end of the command if everything was all right) instead of creating special markers for different commands?

That way there would be only 1 place to check for what happened ...
-- 
best regards

  Ray

← back to recent threads