All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set
@ 2020-05-29 10:01 Mauro Queirós
  2020-05-29 10:01 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mauro Queiros

Git-LFS objects were being fetched even when lfs=0 was not set.
This patch disables LFS smudging when lfs=0. That way, only the LFS pointers
are downloaded during checkout.

Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
---
 lib/bb/fetch2/git.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 5b3793a7..4c7d388e 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -475,6 +475,9 @@ class Git(FetchMethod):
 
         need_lfs = ud.parm.get("lfs", "1") == "1"
 
+        if not need_lfs:
+            ud.basecmd = "GIT_LFS_SKIP_SMUDGE=1 " + ud.basecmd
+
         source_found = False
         source_error = []
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set.
  2020-05-29 10:01 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
@ 2020-05-29 10:01 ` Mauro Queirós
  2020-05-29 10:14   ` Mauro Queirós
  2020-05-29 10:01 ` [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects Mauro Queirós
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mauro Queiros

The message "Repository %s has LFS content but it is not being fetched" was
being printed, even when Git-LFS was available and "lfs=1" was set. In those
situations, we want to fetch LFS content, so that message would not make sense.

Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 4c7d388e..eab76a10 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -509,7 +509,7 @@ class Git(FetchMethod):
         if self._contains_lfs(ud, d, destdir):
             if need_lfs and not self._find_git_lfs(d):
                 raise bb.fetch2.FetchError("Repository %s has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)" % (repourl))
-            else:
+            elif not need_lfs:
                 bb.note("Repository %s has LFS content but it is not being fetched" % (repourl))
 
         if not ud.nocheckout:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects.
  2020-05-29 10:01 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
  2020-05-29 10:01 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós
@ 2020-05-29 10:01 ` Mauro Queirós
  2020-05-29 10:14   ` Mauro Queirós
  2020-05-29 10:14 ` [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
  2020-05-29 10:32 ` ✗ patchtest: failure for "[v2] git.py: skip smudging if ..." and 2 more Patchwork
  3 siblings, 1 reply; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mauro Queiros

Function "contains_lfs" was only looking at the master branch when searching for LFS
content. LFS may be configured in specific branches only, so we need to use the
correct branch.

Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
---
 lib/bb/fetch2/git.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index eab76a10..dbf87156 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -566,8 +566,15 @@ class Git(FetchMethod):
         """
         Check if the repository has 'lfs' (large file) content
         """
-        cmd = "%s grep lfs HEAD:.gitattributes | wc -l" % (
-                ud.basecmd)
+
+        if not ud.nobranch:
+            branchname = ud.branches[ud.names[0]]
+        else:
+            branchname = "master"
+
+        cmd = "%s grep lfs origin/%s:.gitattributes | wc -l" % (
+            ud.basecmd, ud.branches[ud.names[0]])
+
         try:
             output = runfetchcmd(cmd, d, quiet=True, workdir=wd)
             if int(output) > 0:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set.
  2020-05-29 10:01 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós
@ 2020-05-29 10:14   ` Mauro Queirós
  0 siblings, 0 replies; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:14 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]

Please ignore. This was meant to bitbake-devel mailing list.

Mauro Queiros <maurofrqueiros@gmail.com> escreveu no dia sexta, 29/05/2020
à(s) 11:02:

> The message "Repository %s has LFS content but it is not being fetched" was
> being printed, even when Git-LFS was available and "lfs=1" was set. In
> those
> situations, we want to fetch LFS content, so that message would not make
> sense.
>
> Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
> ---
>  lib/bb/fetch2/git.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 4c7d388e..eab76a10 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -509,7 +509,7 @@ class Git(FetchMethod):
>          if self._contains_lfs(ud, d, destdir):
>              if need_lfs and not self._find_git_lfs(d):
>                  raise bb.fetch2.FetchError("Repository %s has LFS
> content, install git-lfs on host to download (or set lfs=0 to ignore it)" %
> (repourl))
> -            else:
> +            elif not need_lfs:
>                  bb.note("Repository %s has LFS content but it is not
> being fetched" % (repourl))
>
>          if not ud.nocheckout:
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 1730 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects.
  2020-05-29 10:01 ` [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects Mauro Queirós
@ 2020-05-29 10:14   ` Mauro Queirós
  0 siblings, 0 replies; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:14 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

 Please ignore. This was meant to bitbake-devel mailing list.

Mauro Queiros <maurofrqueiros@gmail.com> escreveu no dia sexta, 29/05/2020
à(s) 11:02:

> Function "contains_lfs" was only looking at the master branch when
> searching for LFS
> content. LFS may be configured in specific branches only, so we need to
> use the
> correct branch.
>
> Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
> ---
>  lib/bb/fetch2/git.py | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index eab76a10..dbf87156 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -566,8 +566,15 @@ class Git(FetchMethod):
>          """
>          Check if the repository has 'lfs' (large file) content
>          """
> -        cmd = "%s grep lfs HEAD:.gitattributes | wc -l" % (
> -                ud.basecmd)
> +
> +        if not ud.nobranch:
> +            branchname = ud.branches[ud.names[0]]
> +        else:
> +            branchname = "master"
> +
> +        cmd = "%s grep lfs origin/%s:.gitattributes | wc -l" % (
> +            ud.basecmd, ud.branches[ud.names[0]])
> +
>          try:
>              output = runfetchcmd(cmd, d, quiet=True, workdir=wd)
>              if int(output) > 0:
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 1915 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set
  2020-05-29 10:01 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
  2020-05-29 10:01 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós
  2020-05-29 10:01 ` [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects Mauro Queirós
@ 2020-05-29 10:14 ` Mauro Queirós
  2020-05-29 10:32 ` ✗ patchtest: failure for "[v2] git.py: skip smudging if ..." and 2 more Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:14 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

 Please ignore. This was meant to bitbake-devel mailing list.

Mauro Queiros <maurofrqueiros@gmail.com> escreveu no dia sexta, 29/05/2020
à(s) 11:02:

> Git-LFS objects were being fetched even when lfs=0 was not set.
> This patch disables LFS smudging when lfs=0. That way, only the LFS
> pointers
> are downloaded during checkout.
>
> Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
> ---
>  lib/bb/fetch2/git.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
> index 5b3793a7..4c7d388e 100644
> --- a/lib/bb/fetch2/git.py
> +++ b/lib/bb/fetch2/git.py
> @@ -475,6 +475,9 @@ class Git(FetchMethod):
>
>          need_lfs = ud.parm.get("lfs", "1") == "1"
>
> +        if not need_lfs:
> +            ud.basecmd = "GIT_LFS_SKIP_SMUDGE=1 " + ud.basecmd
> +
>          source_found = False
>          source_error = []
>
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 1406 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✗ patchtest: failure for "[v2] git.py: skip smudging if ..." and 2 more
  2020-05-29 10:01 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
                   ` (2 preceding siblings ...)
  2020-05-29 10:14 ` [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
@ 2020-05-29 10:32 ` Patchwork
  3 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2020-05-29 10:32 UTC (permalink / raw)
  To: Mauro Queirós; +Cc: openembedded-core

== Series Details ==

Series: "[v2] git.py: skip smudging if ..." and 2 more
Revision: 1
URL   : https://patchwork.openembedded.org/series/24383/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 662c688e63)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set.
  2020-05-29 10:06 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
@ 2020-05-29 10:06 ` Mauro Queirós
  0 siblings, 0 replies; 8+ messages in thread
From: Mauro Queirós @ 2020-05-29 10:06 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Mauro Queiros

The message "Repository %s has LFS content but it is not being fetched" was
being printed, even when Git-LFS was available and "lfs=1" was set. In those
situations, we want to fetch LFS content, so that message would not make sense.

Signed-off-by: Mauro Queiros <maurofrqueiros@gmail.com>
---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 4c7d388e..eab76a10 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -509,7 +509,7 @@ class Git(FetchMethod):
         if self._contains_lfs(ud, d, destdir):
             if need_lfs and not self._find_git_lfs(d):
                 raise bb.fetch2.FetchError("Repository %s has LFS content, install git-lfs on host to download (or set lfs=0 to ignore it)" % (repourl))
-            else:
+            elif not need_lfs:
                 bb.note("Repository %s has LFS content but it is not being fetched" % (repourl))
 
         if not ud.nocheckout:
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-29 10:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 10:01 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
2020-05-29 10:01 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós
2020-05-29 10:14   ` Mauro Queirós
2020-05-29 10:01 ` [PATCH v2 3/3] git.py: Use the correct branch to check if the repository has LFS objects Mauro Queirós
2020-05-29 10:14   ` Mauro Queirós
2020-05-29 10:14 ` [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
2020-05-29 10:32 ` ✗ patchtest: failure for "[v2] git.py: skip smudging if ..." and 2 more Patchwork
2020-05-29 10:06 [PATCH v2 1/3] git.py: skip smudging if lfs=0 is set Mauro Queirós
2020-05-29 10:06 ` [PATCH v2 2/3] git.py: LFS bitbake note should not be printed if need_lfs is not set Mauro Queirós

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.