All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Heidelberg <markus.heidelberg@web.de>
To: Marco Costalba <mcostalba@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH QGit RFC] Fix "Save patch..." on a commit range
Date: Tue, 16 Jun 2009 01:44:01 +0200	[thread overview]
Message-ID: <200906160144.02320.markus.heidelberg@web.de> (raw)
In-Reply-To: <e5bfff550906151445m2f38c3fw964e01251d9568b9@mail.gmail.com>

Marco Costalba, 15.06.2009:
> So you could check, in ListView::getSelectedItems() how the rows are returned.

I added this snippet:

-->8--

diff --git a/src/listview.cpp b/src/listview.cpp
index b2f4915..5bd1ee6 100644
--- a/src/listview.cpp
+++ b/src/listview.cpp
@@ -171,10 +171,12 @@ void ListView::showIdValues() {
 	viewport()->update();
 }
 
+#include <QtDebug>
 void ListView::getSelectedItems(QStringList& selectedItems) {
 
 	selectedItems.clear();
 	QModelIndexList ml = selectionModel()->selectedRows();
+	qDebug() << ml;
 	FOREACH (QModelIndexList, it, ml)
 		selectedItems.append(sha((*it).row()));
 }

--8<--

and got the following for the 4 commits around v1.6.3 in git.git when
enabled "All branches" (output prettified, was one line):

(QModelIndex(2554,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(2553,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(2552,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(2551,0,0x0,FileHistory(0xa06bfe8) )  )

Here it is ordered from oldest to newest. The newest commit (HEAD or
working tree) has '0'.

The same with "All branches" unchecked, just a bit smaller values:

(QModelIndex(404,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(403,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(402,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(401,0,0x0,FileHistory(0xa06bfe8) )  )

But try with selecting many commits, for example v1.6.3..origin/master
(fewer are sufficient). The order has a pattern, but it's not sorted at
all.

Or selecting only two commits v1.6.3 and origin/master prints this for
me, ordered from newest to oldest this time:

(QModelIndex(16,0,0x0,FileHistory(0xa06bfe8) )  ,
 QModelIndex(401,0,0x0,FileHistory(0xa06bfe8) )  )

      parent reply	other threads:[~2009-06-15 23:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-12 23:29 [PATCH QGit RFC] Fix "Save patch..." on a commit range Markus Heidelberg
2009-06-13  7:13 ` Marco Costalba
2009-06-13 10:11   ` Markus Heidelberg
2009-06-13 11:02   ` Markus Heidelberg
2009-06-13 11:12     ` Marco Costalba
2009-06-13 11:33       ` Markus Heidelberg
2009-06-13 12:23         ` Marco Costalba
2009-06-15 21:13         ` Markus Heidelberg
2009-06-15 21:25           ` Marco Costalba
2009-06-15 21:45             ` Marco Costalba
2009-06-15 22:07               ` Marco Costalba
2009-06-15 23:53                 ` Markus Heidelberg
2009-06-16  6:10                   ` Marco Costalba
2009-06-16 18:48                     ` Markus Heidelberg
2009-06-15 23:44               ` Markus Heidelberg [this message]

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

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

  git send-email \
    --in-reply-to=200906160144.02320.markus.heidelberg@web.de \
    --to=markus.heidelberg@web.de \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.