git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "J. Longman" <longman@xiplink.com>
Cc: git@vger.kernel.org
Subject: Re: jgit as a jira plugin
Date: Fri, 31 Oct 2008 07:42:58 -0700	[thread overview]
Message-ID: <20081031144258.GS14786@spearce.org> (raw)
In-Reply-To: <C9B1B0D7-6F99-48DE-8593-A13F1187ADE2@xiplink.com>

"J. Longman" <longman@xiplink.com> wrote:
> Right, I see now, I thought there was going to be more detail.  Anyways, 
> I'm wondering if there is some action required to ensure it reads from 
> the database vs. the working directory?  I'm assuming it is still looking 
> at the workspace as this is what I'm seeing:
>
> ...RevisionIndexer] Latest indexed revision for repository=1 is :  
> 29ed4398d047ba5e0d6fbad9ebbf98304b0fc503
> ...GitManagerImpl] Fetch...
> ...GitManagerImpl] From /Users/longman/workspace2/work/../masterRepo/
> ...GitManagerImpl]    c209b0f..594e8ff  master     -> origin/master
> ...GitManagerImpl] scan for repo changes...  
> repository.scanForRepoChanges();
> ...GitManagerImpl] scan for repo changes... complete
> ...RevisionIndexer] testing 29ed4398d047ba5e0d6fbad9ebbf98304b0fc503 at 
> CORE-23 sdjskl
> ...RevisionIndexer] 	update latest as  
> 29ed4398d047ba5e0d6fbad9ebbf98304b0fc503 at Wed Oct 29 18:49:54 EDT 2008

Oh.

Your RevisionIndexer must be looking at HEAD, which is the current
branch data.  However the fetch process updated the remote tracking
refs, which are in a different namespace.

You should point your indexer at "origin/master", or use a bare
repository (one with no working directory) and fetch directly into
"refs/heads/*" instead of into "refs/remotes/origin/*", that way
the indexer can look at branch "master".

Fetch doesn't ever touch the working directory; it only updates
the database in the background and the refs/remotes/ namespace so
that other applications can see the data that was transferred and
choose how to process it.

In command line Git "git pull" uses "git fetch" to get the data
and then uses the received data to update the working directory.
But a lot of workflows also will just issue "git fetch" on their own
to get the data, then examine it with "gitk --all", or do nothing
at all because they are mirroring the data, or have to close their
laptop and catch a bus, etc...

If all you are doing is scanning the revision history and the
files via JGit you just have to run a Transport.fetch() call and
then look at the refs that were updated during that call.  See the
FetchResult object you get returned for the list; it is what the
pgm.Fetch class uses to display the output cited above.

-- 
Shawn.

      parent reply	other threads:[~2008-10-31 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-29 23:02 jgit as a jira plugin J. Longman
2008-10-29 23:08 ` Shawn O. Pearce
2008-10-29 23:49   ` J. Longman
2008-10-29 23:53     ` Shawn O. Pearce
     [not found]       ` <C9B1B0D7-6F99-48DE-8593-A13F1187ADE2@xiplink.com>
2008-10-31 14:42         ` Shawn O. Pearce [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=20081031144258.GS14786@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=longman@xiplink.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 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 NNTP newsgroup(s).