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

Re: [EGIT PATCH 1/2] Add utilities for figuring out repositories for selected resources

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Sep 2, 2008, 18:53 UTC
Message-ID
<200809022053.35419.robin.rosenberg.lists@dewire.com>
In-Reply-To
<20080902150323.GC28704@spearce.org>
tisdagen den 2 september 2008 17.03.23 skrev Shawn O. Pearce:
Show 17 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > We want to go from selected resources to repositories and back
> > to any resource in those repositories
> ...
> > +	protected Repository[] getRepositoriesFor(final IProject[] projects) {
> > +		Set<Repository> ret = new HashSet<Repository>();
> > +		for (IProject project : projects) {
> > +			RepositoryMapping repositoryMapping = RepositoryMapping.getMapping(project);
> > +			if (repositoryMapping == null)
> > +				return new Repository[0];
> > +			ret.add(repositoryMapping.getRepository());
> > +		}
> 
> Hmm.  So if any one of the selected projects doesn't have a Git
> repository at its top level we just plain fail and pretend none of
> them have a Git repository?  That doesn't seem right to me.  We
> should just skip that project and move to another project.

That is the way everything in Eclipse work. For an operation to be applicable to a selection, it must be applicable to eache element. Yes, I get annoyed at that sometimes myself, but that doesn't convince me we should be the one plugin that breaks the pattern.

Actually what happens is that the whole action gets disabled if all projects do not satisfy the criteria.

Show 6 quoted lines
> But I also wonder if that really makes sense when a project could
> have a linked resource under it that points to the repository's
> working directory.  In such cases we want operations on that project
> to potentially impact the inner repository as maybe the project
> repository does not have a repository itself.  IOW I'm questioning
> the idea of getRepositoriesFor(getProjectsForSelectedResources()).

Ouch for linked resources. I really think we should ignore the link as much as we can. It's a trap! I any way it needs more fixing that this and not only here. A patch does not have to solve all problems in the world :)

I have no experience with linked resources, other that I found them enough awkward to use to prevent from doing that. How useful and portable is a C:\foo on my system? I don't mind anyone solving the problem, but it is very low on my personal agenda.

-- robin
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 5 of 6 in “Select all changes in repository for commit by default”
  1. Select all changes in repository for commit by defaultRobin Rosenberg, Aug 31, 2008
  2. 1/2 Add utilities for figuring out repositories for selected resourcesRobin Rosenberg, Aug 31, 2008
  3. 2/2 Enable commit for any resource in a Git-shared projectRobin Rosenberg, Aug 31, 2008
  4. Shawn O. PearceSep 2, 2008
  5. Robin RosenbergSep 2, 2008
  6. Shawn O. PearceSep 2, 2008

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.