git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Xenos <sxenos@google.com>
To: szeder.dev@gmail.com
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	git@vger.kernel.org, Stefan Beller <sbeller@google.com>,
	Jonathan Nieder <jrn@google.com>, Junio C Hamano <jch@google.com>,
	Jonathan Tan <jonathantanmy@google.com>,
	Derrick Stolee <stolee@gmail.com>,
	Carl Baldwin <carl@ecbaldwin.net>,
	Dave Borowitz <dborowitz@google.com>
Subject: Re: [PATCH] technical doc: add a design doc for the evolve command
Date: Mon, 19 Nov 2018 13:32:30 -0800	[thread overview]
Message-ID: <CAPL8ZivQGGrxjerGxd_R42mJ2XCi_fFcOji3PL0=pWRAZ_OJQQ@mail.gmail.com> (raw)
In-Reply-To: <20181119155545.GT30222@szeder.dev>

> Subcommand names and --long-options are just as descriptive.

Yeah, I'm convinced about the descriptiveness. If you check the latest
version of the patch, I've already updated the "change" command to use
subcommands rather than lettered arguments.

> If a user wants to deal with reflogs, then there is 'git help reflog'

I guess it depends on whether you prefer having a single big help page
(risk: user may see irrelevant content), or a number of small help
pages (risk: user may need to follow cross-references). My guess is
that we should probably try to hit the sweet spot that minimizes the
amount of irrelevant information on a help page, the probability of
needing to follow a cross-reference to understand context, and the
amount of content that needs to be duplicated between pages.

But assuming we add a bunch of formatting options to obslog that match
log, it may make sense to just have an "--obslog" argument to log.

> I think 'git obslog' should allow the same when showing the log of a change.

Sounds good. We should probably also change the default formatting for
the obslog command to be some sort of description of what changed
since the commit message will probably be very similar for every
entry. I'll update the proposal to mention formatting options once we
sort out where obslog will actually live.

> By adding several new commands users will have to consult the manpages of 'evolve',
> 'change', 'obslog', etc., even though the commands and the concepts are closely related.

I'm not sure that's the case. There is some common background material
you'd need to understand in order to use any of those commands ("what
are changes?"), but the same could be said of pretty much any git
command ("what are commits?"). Assuming the user knows what a change
is, I'm pretty sure I could write a self-contained description for
evolve, change, or obslog that doesn't require cross-referencing any
of the other commands... and the evolve command could probably be
understood even without understanding changes.

But since several comments have focused on the commands, let's brainstorm!

Here's some options that occur to me:
1. Three commands: evolve + change + obslog as top-level commands (the
current proposal). Change gets a bunch of subcommands for manipulating
the change graph and metas/ namespace.
2. All top-level: evolve + lschange + mkchange + rmchange +
prunechange + obslog. None of the commands get subcommands.
3. Everything under change: "change evolve", "change obslog" become
new change subcommands.
4. Evolve as a rebase argument, obslog as a log argument. Use "rebase
--evolve" to initiate evolve and use "log --obslog" to initiate
obslog. The change command stays as it is in the proposal.
5. Two commands: evolve + change. obslog becomes a "log" argument.

Note that there will be more "evolve"-specific arguments in the
future. For most transformations that evolve uses, there will be a
matching argument to enable or disable that transformation and as we
add transformations we'll also add arguments.

If we go with option 3, it would make for a very cluttered help page.
For example, if you're looking for information on how to use evolve,
you'd have to scroll past a bunch of formatting information that are
only relevant to obslog... and if you're looking for the formatting
options, you'd have to scroll past a bunch of
transformation-enablement options that are only relevant to evolve.

Based on your log feedback above, I'm thinking #5 may make sense.

  - Stefan
On Mon, Nov 19, 2018 at 7:55 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
>
> On Sat, Nov 17, 2018 at 12:30:58PM -0800, Stefan Xenos wrote:
> > > Further, I see that this document tries to suggest a proliferation of new commands
> >
> > It does. Let me explain a bit about the reasoning behind this
> > breakdown of commands. My main priority was to keep the commands as
> > consistent with existing git commands as possible. Secondary goals
> > were:
> > - Mapping a single intent to a single command where possible makes it
> > easier to explain what that command does.
> > - Having lots of simpler commands as opposed to a few complex commands
> > makes them easier to type.
> > - Command names are more descriptive than lettered arguments.
>
> Subcommand names and --long-options are just as descriptive.
>
>
> > Git already has a "log" and "reflog" command for displaying two
> > different types of log,
>
> No, there is 'git log' for displaying logs in various ways, and there
> is 'git reflog' which not only displays reflogs, but also operates on
> them, e.g. deletes specific reflog entries or expires old entries,
> necessitating and justifying the dedicated 'git reflog' command.
>
> > so putting "obslog" on its own command makes
> > it consistent with the existing logs, easier to type, and keeps the
> > command simple.
>
> > - We could turn "obslog" into an extra option on the "log" command,
> > but that would be inconsistent with reflog and would complicate the
> > already-complex log command.
>
> On one hand, it's unclear to me what additional operations the
> proposed 'git obslog' command will perform besides showing the log of
> a change.  If there are no such operations, then it can't really be
> compared to 'git reflog' to justify a dedicated 'git obslog' command.
>
> OTOH, note that 'git log' already has a '--walk-reflogs' option, and
> indeed 'git reflog [show]' is implemented via the common log
> machinery.  And this is not a mere implementation detail, because "git
> reflog show accepts any of the options accepted by git log" (quoting
> its manpage), making it possible to filter, limit and format reflog
> entries, e.g.:
>
>   git reflog --format='%h %cd %s' --author=szeder -5 branch file
>
> I think 'git obslog' should allow the same when showing the log of a
> change.
>
>
> > Personally, I don't
> > consider a proliferation of new commands to be inherently bad (or
> > inherently good, really). Is there a reason new commands should be
> > avoided?
>
> If a user wants to deal with reflogs, then there is 'git help reflog'
> which in one manpage describes the concept, and how to list and
> expire reflogs and delete individual entries from a reflog using the
> various subcommands.  If a user wants to deal with stashes, then there
> is 'git help stash', which in one manpage describes the concept, and
> how to create, list, show, apply, delete, etc. stashes using the
> various subcommands.  See where this is going?  The same applies to
> bisect, notes, remotes, rerere, submodules, worktree; maybe there are
> more.  This is a Good Thing.
>
> By adding several new commands users will have to consult the manpages
> of 'evolve', 'change', 'obslog', etc., even though the commands and
> the concepts are closely related.
>
>

  reply	other threads:[~2018-11-19 21:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15  0:55 [PATCH] technical doc: add a design doc for the evolve command sxenos
2018-11-15 12:52 ` Johannes Schindelin
2018-11-17 20:30   ` Stefan Xenos
2018-11-19 15:55     ` SZEDER Gábor
2018-11-19 21:32       ` Stefan Xenos [this message]
2018-11-20  1:09         ` Jonathan Nieder
2018-11-15 15:36 ` Ævar Arnfjörð Bjarmason
2018-11-20  1:18   ` Jonathan Nieder
2018-11-20  9:43     ` Ævar Arnfjörð Bjarmason
2018-11-20 17:45       ` Stefan Xenos
2018-11-20 22:06         ` Jonathan Nieder
2018-11-20 23:45           ` Stefan Xenos
2018-11-21  1:33             ` Jonathan Nieder
2018-11-21 19:10               ` Stefan Xenos
2018-11-16 21:36 ` Derrick Stolee
2018-11-17 23:44   ` Stefan Xenos
2018-11-17  6:06 ` Duy Nguyen
2018-11-18 22:27   ` Stefan Xenos
2018-11-18 22:29     ` Stefan Xenos
2018-11-18 23:20     ` Junio C Hamano
2018-11-17  7:36 ` Junio C Hamano
2018-11-19  0:36   ` Stefan Xenos
2018-11-19  2:15     ` Junio C Hamano
2018-11-19  3:33       ` Stefan Xenos
2018-11-19  3:45         ` Junio C Hamano
2018-11-19  4:15         ` Junio C Hamano
2018-11-19 20:14           ` Stefan Xenos
2018-11-19 20:26             ` Jonathan Nieder
2018-11-20  1:03             ` Junio C Hamano
2018-11-20 17:27               ` Stefan Xenos
2018-11-20 12:18 ` Phillip Wood
2018-11-20 12:59   ` Phillip Wood
2018-11-20 20:19   ` Stefan Xenos
2019-01-15 11:16     ` Phillip Wood
2018-11-20 13:03 ` Phillip Wood
2018-11-20 20:24   ` Stefan Xenos
2018-11-21 12:14     ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPL8ZivQGGrxjerGxd_R42mJ2XCi_fFcOji3PL0=pWRAZ_OJQQ@mail.gmail.com' \
    --to=sxenos@google.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=carl@ecbaldwin.net \
    --cc=dborowitz@google.com \
    --cc=git@vger.kernel.org \
    --cc=jch@google.com \
    --cc=jonathantanmy@google.com \
    --cc=jrn@google.com \
    --cc=sbeller@google.com \
    --cc=stolee@gmail.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).