You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2024/04/10 08:01:51 UTC

(incubator-devlake) branch kw-gitext-error-on-empty-repo created (now f1b49def8)

This is an automated email from the ASF dual-hosted git repository.

klesh pushed a change to branch kw-gitext-error-on-empty-repo
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


      at f1b49def8 fix: more friendly msg when no data with shallow clone

This branch includes the following new commits:

     new f1b49def8 fix: more friendly msg when no data with shallow clone

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-devlake) 01/01: fix: more friendly msg when no data with shallow clone

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-gitext-error-on-empty-repo
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit f1b49def848388fe9988acfa57fe96ff332b2e31
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Wed Apr 10 15:58:41 2024 +0800

    fix: more friendly msg when no data with shallow clone
---
 backend/plugins/gitextractor/parser/clone_gitcli.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backend/plugins/gitextractor/parser/clone_gitcli.go b/backend/plugins/gitextractor/parser/clone_gitcli.go
index dd81b284f..a1f5b9cc9 100644
--- a/backend/plugins/gitextractor/parser/clone_gitcli.go
+++ b/backend/plugins/gitextractor/parser/clone_gitcli.go
@@ -110,6 +110,7 @@ func (g *GitcliCloner) CloneRepo(ctx plugin.SubTaskContext, localDir string) err
 	if *taskData.Options.SkipCommitStat {
 		args = append(args, "--filter=blob:none")
 	}
+	fmt.Printf("%v", args)
 	cmd := exec.CommandContext(ctx.GetContext(), "git", args...)
 	cmd.Env = env
 	// stdout, stderr := cmd.CombinedOutput()
@@ -157,6 +158,9 @@ func (g *GitcliCloner) CloneRepo(ctx plugin.SubTaskContext, localDir string) err
 	err = cmd.Wait()
 	if err != nil {
 		g.logger.Error(err, "git exited with error\n%s", combinedOutput.String())
+		if strings.Contains(combinedOutput.String(), "stderr: fatal: error processing shallow info: 4") {
+			return errors.BadInput.New("No data found for the selected time range. Please revise the 'Time Range' on your Project/Blueprint/Configuration page or in the API parameter.")
+		}
 		return errors.Default.New("git exit error")
 	}
 	return nil