git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bugreport: Prefix - is ignored when sorting (on committerdate)

From
FÖFredrik Öberg <fredrik@bakskuru.se>
Date
Jan 10, 2023, 09:02 UTC
Message-ID
<CALDp=1EVmQE2NZAd7ccAT0z=R=2S8FvyJzsPNrDeXwdJkEW3Lg@mail.gmail.com>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
- Create a new repository
- Add a new file to the repository and commit
- Create a tag
$ git tag -a TagOne -m ""
- Update the file and commit the change
- Create a tag
$ git tag -a TagTwo -m ""
- List tags by committerdate:
$ git tag -l --sort=committerdate
(oldest tag is listed first)
- List tags by reversed committerdate:
$ git tag -l --sort=-committerdate
(oldest tag it still listed first)

What did you expect to happen? (Expected behavior) Using the minus-sign as prefix is supposed to reverse the sorting order, listing the newest item first. I expected the newest tag to be listed first

What happened instead? (Actual behavior) The minus-sign was ignored, and the oldest tag was still listed first

What's different between what you expected and what actually happened? I expected the newest tag to be listed first when the minus-sign was used as a prefix, but the oldest tag was still listed first.

Anything else you want to add: The correct behaviour (reversing sort-order by using the minus-prefix) has been verified in version 2.11.0, 2.11.1, 2.14.2, 2.19.1, 2.19.2, 2.23.0 on CentOS 7.4 version 2.31.1 and 2.35.1 on CentOS 7.4 contains the error version 2.34.1.windows.1 contains the error

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.34.1.windows.1 cpu: x86_64 built from commit: 2ca94ab318509b3c271e82889938816bad76dfea sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 19042 compiler info: gnuc: 11.2 libc info: no libc information available $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks]
Next: Martin Ågren
Message 1 of 6 in “Bugreport: Prefix - is ignored when sorting (on committerdate)”
  1. Fredrik ÖbergJan 10, 2023
  2. Martin ÅgrenJan 10, 2023
  3. Jeff KingJan 10, 2023
  4. Martin ÅgrenJan 10, 2023
  5. Fredrik ÖbergJan 10, 2023
  6. Jeff KingJan 10, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.