Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
f1486154
Commit
f1486154
authored
7 years ago
by
Ximin Luo
Browse files
Options
Downloads
Patches
Plain Diff
Add a Difference.from_command_exc to distinguish excluded commands from empty diff
parent
bfbb1223
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
diffoscope/comparators/elf.py
+9
-3
9 additions, 3 deletions
diffoscope/comparators/elf.py
diffoscope/difference.py
+12
-7
12 additions, 7 deletions
diffoscope/difference.py
with
21 additions
and
10 deletions
diffoscope/comparators/elf.py
+
9
−
3
View file @
f1486154
...
...
@@ -336,17 +336,23 @@ class ElfCodeSection(ElfSection):
# Normally disassemble with line numbers, but if the command is
# excluded, fallback to disassembly, and if that is also excluded,
# fallback to a hexdump.
return
Difference
.
from_command
(
diff
,
excluded
=
Difference
.
from_command
_exc
(
ObjdumpDisassembleSection
,
self
.
path
,
other
.
path
,
command_args
=
[
self
.
_name
],
)
or
Difference
.
from_command
(
)
if
not
excluded
:
return
diff
diff
,
excluded
=
Difference
.
from_command_exc
(
ObjdumpDisassembleSectionNoLineNumbers
,
self
.
path
,
other
.
path
,
command_args
=
[
self
.
_name
],
)
or
super
().
compare
(
other
,
source
)
)
if
not
excluded
:
return
diff
return
super
().
compare
(
other
,
source
)
class
ElfStringSection
(
ElfSection
):
...
...
This diff is collapsed.
Click to expand it.
diffoscope/difference.py
+
12
−
7
View file @
f1486154
...
...
@@ -226,6 +226,10 @@ class Difference(object):
@staticmethod
def
from_command
(
klass
,
path1
,
path2
,
*
args
,
**
kwargs
):
return
Difference
.
from_command_exc
(
klass
,
path1
,
path2
,
*
args
,
**
kwargs
)[
0
]
@staticmethod
def
from_command_exc
(
klass
,
path1
,
path2
,
*
args
,
**
kwargs
):
command_args
=
[]
if
'
command_args
'
in
kwargs
:
command_args
=
kwargs
[
'
command_args
'
]
...
...
@@ -239,14 +243,15 @@ class Difference(object):
command
=
klass
(
path
,
*
command_args
)
feeder
=
feeders
.
from_command
(
command
)
if
command_excluded
(
command
.
shell_cmdline
()):
return
None
,
None
return
None
,
None
,
True
command
.
start
()
return
feeder
,
command
return
feeder
,
command
,
False
feeder1
,
command1
=
command_and_feeder
(
path1
)
feeder2
,
command2
=
command_and_feeder
(
path2
)
feeder1
,
command1
,
excluded1
=
command_and_feeder
(
path1
)
feeder2
,
command2
,
excluded2
=
command_and_feeder
(
path2
)
if
not
feeder1
or
not
feeder2
:
return
None
assert
excluded1
or
excluded2
return
None
,
True
if
'
source
'
not
in
kwargs
:
source_cmd
=
command1
or
command2
...
...
@@ -261,7 +266,7 @@ class Difference(object):
**
kwargs
)
if
not
difference
:
return
None
return
None
,
False
if
command1
and
command1
.
stderr_content
:
difference
.
add_comment
(
"
stderr from `{}`:
"
.
format
(
...
...
@@ -274,7 +279,7 @@ class Difference(object):
))
difference
.
add_comment
(
command2
.
stderr_content
)
return
difference
return
difference
,
False
@property
def
comment
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment