Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
brew
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KMSCAKKSCFKA AKFACAMADCAS
brew
Commits
623c95b3
Commit
623c95b3
authored
8 years ago
by
Mike McQuaid
Browse files
Options
Downloads
Patches
Plain Diff
cmd/log: improve output messaging.
This wasn’t adapted to the new, multiple repository world.
parent
8cedd627
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Library/Homebrew/cmd/log.rb
+20
-8
20 additions, 8 deletions
Library/Homebrew/cmd/log.rb
Library/Homebrew/test/cmd/log_spec.rb
+1
-1
1 addition, 1 deletion
Library/Homebrew/test/cmd/log_spec.rb
with
21 additions
and
9 deletions
Library/Homebrew/cmd/log.rb
+
20
−
8
View file @
623c95b3
...
...
@@ -9,20 +9,32 @@ module Homebrew
def
log
if
ARGV
.
named
.
empty?
cd
HOMEBREW_REPOSITORY
git_log
git_log
HOMEBREW_REPOSITORY
else
path
=
Formulary
.
path
(
ARGV
.
named
.
first
)
cd
path
.
dirname
# supports taps
git_log
path
tap
=
Tap
.
from_path
(
path
)
git_log
path
.
dirname
,
path
,
tap
end
end
def
git_log
(
path
=
nil
)
if
File
.
exist?
"
#{
`git rev-parse --show-toplevel`
.
chomp
}
/.git/shallow"
def
git_log
(
cd_dir
,
path
=
nil
,
tap
=
nil
)
cd
cd_dir
repo
=
Utils
.
popen_read
(
"git rev-parse --show-toplevel"
).
chomp
if
tap
name
=
tap
.
to_s
git_cd
=
"$(brew --repo
#{
tap
}
)"
elsif
cd_dir
==
HOMEBREW_REPOSITORY
name
=
"Homebrew/brew"
git_cd
=
"$(brew --repo)"
else
name
,
git_cd
=
cd_dir
end
if
File
.
exist?
"
#{
repo
}
/.git/shallow"
opoo
<<-
EOS
.
undent
The git repository is a shallow clone therefore the filtering may be incorrect.
Use `git fetch --unshallow` to get the full repository.
#{
name
}
is a shallow clone so only partial output will be shown.
To get a full clone run:
git -C "
#{
git_cd
}
" fetch --unshallow
EOS
end
args
=
ARGV
.
options_only
...
...
This diff is collapsed.
Click to expand it.
Library/Homebrew/test/cmd/log_spec.rb
+
1
−
1
View file @
623c95b3
...
...
@@ -33,7 +33,7 @@ describe "brew log", :integration_test do
expect
{
brew
"log"
,
"
#{
shallow_tap
}
/testball"
}
.
to
output
(
/This is a test commit for Testball/
).
to_stdout
.
and
output
(
/
Warning:
The git repository
is a shallow clone
/
).
to_stderr
.
and
output
(
%r{
Warning:
homebrew/shallow
is a shallow clone
}
).
to_stderr
.
and
be_a_success
expect
(
shallow_tap
.
path
/
".git/shallow"
).
to
exist
,
"A shallow clone should have been created."
...
...
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