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
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 2, 2008, 15:03 UTC
Message-ID
<20080902150323.GC28704@spearce.org>
In-Reply-To
<1220175524-1523-2-git-send-email-robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> We want to go from selected resources to repositories and back
> to any resource in those repositories
...
Show 8 quoted lines
> +	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.

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()).

-- 
Shawn.
Previous: Robin RosenbergNext: Robin Rosenberg
Message 4 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.