1
0
mirror of https://github.com/git/git.git synced 2024-10-22 12:28:32 +02:00
git/Documentation
SZEDER Gábor c026557a37 versioncmp: generalize version sort suffix reordering
The 'versionsort.prereleaseSuffix' configuration variable, as its name
suggests, is supposed to only deal with tagnames with prerelease
suffixes, and allows sorting those prerelease tags in a user-defined
order before the suffixless main release tag, instead of sorting them
simply lexicographically.

However, the previous changes in this series resulted in an
interesting and useful property of version sort:

  - The empty string as a configured suffix matches all tagnames,
    including tagnames without any suffix, but

  - tagnames containing a "real" configured suffix are still ordered
    according to that real suffix, because any longer suffix takes
    precedence over the empty string.

Exploiting this property we can easily generalize suffix reordering
and specify the order of tags with given suffixes not only before but
even after a main release tag by using the empty suffix to denote the
position of the main release tag, without any algorithm changes:

  $ git -c versionsort.prereleaseSuffix=-alpha \
        -c versionsort.prereleaseSuffix=-beta \
        -c versionsort.prereleaseSuffix="" \
        -c versionsort.prereleaseSuffix=-gamma \
        -c versionsort.prereleaseSuffix=-delta \
        tag -l --sort=version:refname 'v3.0*'
  v3.0-alpha1
  v3.0-beta1
  v3.0
  v3.0-gamma1
  v3.0-delta1

Since 'versionsort.prereleaseSuffix' is not a fitting name for a
configuration variable to control this more general suffix reordering,
introduce the new variable 'versionsort.suffix'.  Still keep the old
configuration variable name as a deprecated alias, though, to avoid
suddenly breaking setups already using it.  Ignore the old variable if
both old and new configuration variables are set, but emit a warning
so users will be aware of it and can fix their configuration.  Extend
the documentation to describe and add a test to check this more
general behavior.

Note: since the empty suffix matches all tagnames, tagnames with
suffixes not included in the configuration are listed together with
the suffixless main release tag, ordered lexicographically right after
that, i.e. before tags with suffixes listed in the configuration
following the empty suffix.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-01-12 12:25:24 -08:00
..
howto Merge branch 'po/fix-doc-merge-base-illustration' into maint 2016-10-28 09:01:21 -07:00
RelNotes Start post 2.11 cycle 2016-12-05 11:31:47 -08:00
technical Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
.gitattributes
.gitignore
asciidoc.conf
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines
config.txt versioncmp: generalize version sort suffix reordering 2017-01-12 12:25:24 -08:00
date-formats.txt
diff-config.txt Merge branch 'jc/ws-error-highlight' 2016-10-26 13:14:43 -07:00
diff-format.txt
diff-generate-patch.txt
diff-heuristic-options.txt blame: honor the diff heuristic options and config 2016-09-19 10:25:11 -07:00
diff-options.txt Merge branch 'nd/ita-empty-commit' 2016-10-27 14:58:50 -07:00
docbook-xsl.css
docbook.xsl
everyday.txto
fetch-options.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
fix-texi.perl
fmt-merge-msg-config.txt
git-add.txt
git-am.txt
git-annotate.txt blame: honor the diff heuristic options and config 2016-09-19 10:25:11 -07:00
git-apply.txt
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt
git-bisect.txt
git-blame.txt Merge branch 'jc/blame-reverse' 2016-10-10 14:03:51 -07:00
git-branch.txt
git-bundle.txt
git-cat-file.txt
git-check-attr.txt
git-check-ignore.txt
git-check-mailmap.txt
git-check-ref-format.txt git-check-ref-format.txt: fixup documentation 2016-09-21 11:12:41 -07:00
git-checkout-index.txt
git-checkout.txt checkout.txt: document a common case that ignores ambiguation rules 2016-09-21 08:44:41 -07:00
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
git-column.txt
git-commit-tree.txt
git-commit.txt Merge branch 'nd/commit-p-doc' into maint 2016-10-28 09:01:15 -07:00
git-config.txt
git-count-objects.txt count-objects: report alternates via verbose mode 2016-10-10 13:52:37 -07:00
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-credential.txt
git-cvsexportcommit.txt
git-cvsimport.txt Merge branch 'jk/doc-cvs-update' into maint 2016-10-03 13:22:25 -07:00
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
git-fetch.txt
git-filter-branch.txt
git-fmt-merge-msg.txt Documentation/fmt-merge-msg: fix markup in example 2016-10-28 05:51:51 -07:00
git-for-each-ref.txt
git-format-patch.txt format-patch: add "--rfc" for the common case of [RFC PATCH] 2016-09-21 08:58:10 -07:00
git-fsck-objects.txt
git-fsck.txt
git-gc.txt
git-get-tar-commit-id.txt
git-grep.txt
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt
git-init-db.txt
git-init.txt
git-instaweb.txt
git-interpret-trailers.txt doc: mention user-configured trailers 2016-11-21 12:49:57 -08:00
git-log.txt
git-ls-files.txt ls-files: add pathspec matching for submodules 2016-10-10 12:14:58 -07:00
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt doc: fix merge-base ASCII art tab spacing 2016-10-21 09:46:48 -07:00
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt
git-mergetool--lib.txt
git-mergetool.txt mergetool: honor -O<orderfile> 2016-10-11 10:04:31 -07:00
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt
git-p4.txt
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt
git-push.txt
git-quiltimport.txt
git-read-tree.txt
git-rebase.txt
git-receive-pack.txt
git-reflog.txt
git-relink.txt
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt
git-repack.txt
git-replace.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt
git-rev-list.txt
git-rev-parse.txt
git-revert.txt
git-rm.txt
git-send-email.txt
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-stage.txt
git-stash.txt stash: allow stashes to be referenced by index only 2016-10-26 09:58:10 -07:00
git-status.txt
git-stripspace.txt
git-submodule.txt submodules doc: update documentation for "." used for submodule branches 2016-10-19 14:58:53 -07:00
git-svn.txt
git-symbolic-ref.txt
git-tag.txt versioncmp: generalize version sort suffix reordering 2017-01-12 12:25:24 -08:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-commit.txt
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt
git-worktree.txt Merge branch 'nd/worktree-lock' into maint 2016-11-29 13:28:02 -08:00
git-write-tree.txt
git.txt Git 2.11 2016-11-29 12:23:07 -08:00
gitattributes.txt contrib/long-running-filter: add long running filter example 2016-10-17 11:45:52 -07:00
gitcli.txt
gitcore-tutorial.txt
gitcredentials.txt
gitcvs-migration.txt docs/cvs-migration: mention cvsimport caveats 2016-09-22 11:23:45 -07:00
gitdiffcore.txt
giteveryday.txt
gitglossary.txt
githooks.txt
gitignore.txt
gitk.txt Merge branch 'po/range-doc' into maint 2016-09-19 13:51:38 -07:00
gitmodules.txt Merge branch 'bw/submodule-branch-dot-doc' into maint 2016-10-28 09:01:19 -07:00
gitnamespaces.txt
gitremote-helpers.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
gitrepository-layout.txt doc: fix location of 'info/' with $GIT_COMMON_DIR 2016-11-11 09:37:33 -08:00
gitrevisions.txt
gittutorial-2.txt
gittutorial.txt
gitweb.conf.txt gitweb: use highlight's shebang detection 2016-09-25 16:39:11 -07:00
gitweb.txt
gitworkflows.txt
glossary-content.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
line-range-format.txt
lint-gitlink.perl
mailmap.txt
Makefile
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt
merge-options.txt
merge-strategies.txt
pretty-formats.txt Merge branch 'rs/pretty-format-color-doc-fix' into maint 2016-10-28 09:01:23 -07:00
pretty-options.txt
pull-fetch-param.txt
rev-list-options.txt Merge branch 'pb/rev-list-reverse-with-count' into maint 2016-10-11 14:20:06 -07:00
revisions.txt revision: new rev^-n shorthand for rev^n..rev 2016-09-27 10:59:28 -07:00
sequencer.txt
SubmittingPatches
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt