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

Re: [PATCH QGit RFC] Fix "Save patch..." on a commit range

From
MCMarco Costalba <mcostalba@gmail.com>
Date
Jun 16, 2009, 06:10 UTC
Message-ID
<e5bfff550906152310m1dc92bf7vf73fdb8f925e2fb7@mail.gmail.com>
In-Reply-To
<200906160153.28018.markus.heidelberg@web.de>

On Tue, Jun 16, 2009 at 00:53, Markus Heidelberg<markus.heidelberg@web.de> wrote:

>
> Yes, it works. Thanks. Would it make sense and be possible to fix it
> directly in ListView::getSelectedItems()?
>

I am not sure it is a problem of the selected items set. Unfortunatly it is not ordered, but actually this was not documented, so it was my bad to assume rows are always ordered because it happens they are sorted with Qt4.3.3

And also ordering in Git::formatPatch() is easier because the "tools" like appendNamesWithId() are already there and only there.

Another reason is that is Git::formatPatch() that needs the rows to be ordered, so has a sense to do it there where is needed. Of corse if other places of QGit requires that the rows returned by ListView::getSelectedItems() should be ordered then we can move the ordering in ListView::getSelectedItems() as you suggest, or, even better, move the ordering in ListView::getSelectedItems() but from there call a new helper function Git::sortShaByIndex() that does the work and is defined in git.cpp because should use internal information like the index and call directly the sha database.

Yes, a possible cleanup / reformat job could be to:
- Add a new public helper function Git::sortShaByIndex() defined in git.cpp
- Call from ListView::getSelectedItems() when we get the list of sha
user as select
- Document ListView::getSelectedItems() always returns a list of ordered sha's
> BTW, a nice way to see the created git-format-patch command without
> modifying the sources is to use a directory with spaces, which is not
> handled correctly by qgit.
>
????
I cannot test now, but this seems a bug.
Previous: Markus HeidelbergNext: Markus Heidelberg
Message 13 of 15 in “Fix "Save patch..." on a commit range”
  1. Fix "Save patch..." on a commit rangeMarkus Heidelberg, Jun 12, 2009
  2. Marco CostalbaJun 13, 2009
  3. Markus HeidelbergJun 13, 2009
  4. Markus HeidelbergJun 13, 2009
  5. Marco CostalbaJun 13, 2009
  6. Markus HeidelbergJun 13, 2009
  7. Marco CostalbaJun 13, 2009
  8. Markus HeidelbergJun 15, 2009
  9. Marco CostalbaJun 15, 2009
  10. Marco CostalbaJun 15, 2009
  11. Marco CostalbaJun 15, 2009
  12. Markus HeidelbergJun 15, 2009
  13. Marco CostalbaJun 16, 2009
  14. Markus HeidelbergJun 16, 2009
  15. Markus HeidelbergJun 15, 2009

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.