android_webview
apps
ash
base
build
build_overrides
buildtools
cc
chrome
chromecast
chromeos
codelabs
components
content
courgette
crypto
dbus
device
docs
accessibility
autofill
design
enterprise
experiments
fuchsia
gpu
images
infra
intl
ios
lacros
linux
login
mac
media
memory
memory-infra
patterns
privacy
privacy_budget
process
security
speed
speed_metrics
standards
telemetry_extension
testing
ui
updater
webapps
workflow
DIR_METADATA
OWNERS
README.md
accessibility.md
ad_tagging.md
adding_to_third_party.md
android_accessing_cpp_enums_in_java.md
android_accessing_cpp_features_in_java.md
android_accessing_cpp_switches_in_java.md
android_build_instructions.md
android_cast_build_instructions.md
android_debugging_instructions.md
android_dynamic_feature_modules.md
android_emulator.md
android_isolated_splits.md
android_logging.md
android_native_libraries.md
android_studio.md
angle_in_chromium.md
api_keys.md
asan.md
atom.md
bitmap_pipeline.md
branch_sheriff.md
building_old_revisions.md
callback.md
ccache_mac.md
chrome_os_logging.md
chrome_settings.md
chrome_untrusted.md
chromedriver_status.md
chromeos_build_instructions.md
chromeos_glossary.md
chromium_browser_vs_google_chrome.md
cipd_and_3pp.md
cl_respect.md
clang.md
clang_code_coverage_wrapper.md
clang_format.md
clang_sheriffing.md
clang_static_analyzer.md
clang_tidy.md
clang_tool_refactoring.md
clangd.md
clion.md
closure_compilation.md
cocoa_tips_and_tricks.md
code_review_owners.md
code_reviews.md
commit_checklist.md
component_build.md
configuration.md
contributing.md
cq_quick_run.md
cr_respect.md
cr_user_manual.md
cross_platform_ui.md
cygwin_dll_remapping_failure.md
dangling_ptr.md
dangling_ptr_guide.md
dbus_mojo_connection_service.md
debugging_with_crash_keys.md
deterministic_builds.md
disassemble_code.md
documentation_best_practices.md
documentation_guidelines.md
early-hints.md
eclipse.md
emacs.md
erc_irc.md
flag_expiry.md
flag_guarding_guidelines.md
flag_ownership.md
frame_trees.md
gdbinit.md
get_the_code.md
git_cookbook.md
git_tips.md
google_chrome_branded_builds.md
google_play_services.md
graphical_debugging_aid_chromium_views.md
gwp_asan.md
history_manipulation_intervention.md
how_cc_works.md
how_to_add_your_feature_flag.md
how_to_extend_web_test_framework.md
idn.md
initialize_blink_features.md
inlined_stack_traces.md
installation_at_vmware.md
ios_build_instructions.md
ios_infra.md
ios_voiceover.md
kiosk_mode.md
lacros.md
life_of_a_frame.md
lldbinit.md
mac_arm64.md
mac_build_instructions.md
mac_lld.md
mojo_and_services.md
mojo_ipc_conversion.md
mojo_testing.md
native_relocations.md
navbar.md
navigation-request-navigation-state.gv
navigation-request-navigation-state.png
navigation.md
navigation_concepts.md
network_traffic_annotations.md
no_sources_assignment_filter.md
optimizing_web_uis.md
origin_trials_integration.md
ozone_overview.md
parsing_test_results.md
pgo.md
piranha_plant.md
process_model_and_site_isolation.md
profiling.md
profiling_content_shell_on_android.md
proxy_auto_config.md
python3_migration.md
qtcreator.md
release_branch_guidance.md
render-frame-host-lifecycle-state.gv
render-frame-host-lifecycle-state.png
render_document.md
rust.md
seccomp_sandbox_crash_dumping.md
servicification.md
session_history.md
sheriff.md
shutdown.md
special_case_urls.md
static_initializers.md
sublime_ide.md
system_hardening_features.md
tab_helpers.md
threading_and_tasks.md
threading_and_tasks_faq.md
threading_and_tasks_testing.md
toolchain_support.md
tour_of_luci_ui.md
tpm_quick_ref.md
translation_screenshots.md
trusted_types_on_webui.md
updating_clang.md
updating_clang_format_binaries.md
use_counter_wiki.md
useful_urls.md
user_data_dir.md
user_data_storage.md
user_handle_mapping.md
vanilla_msysgit_workflow.md
vscode.md
vscode_python.md
webui_build_configuration.md
webui_explainer.md
webui_in_chrome.md
webui_in_components.md
webview_policies.md
win_cross.md
win_order_files.md
windows_build_instructions.md
windows_native_window_occlusion_tracking.md
windows_pwa_integration.md
windows_shortcut_and_taskbar_handling.md
windows_split_dll.md
windows_virtual_desktop_handling.md
wmax_tokens.md
working_remotely_with_android.md
writing_clang_plugins.md
extensions
fuchsia_web
gin
google_apis
google_update
gpu
headless
infra
ios
ipc
media
mojo
native_client_sdk
net
pdf
ppapi
printing
remoting
rlz
sandbox
services
skia
sql
storage
styleguide
testing
third_party
tools
ui
url
weblayer
.clang-format
.clang-tidy
.eslintrc.js
.git-blame-ignore-revs
.gitattributes
.gitignore
.gn
.mailmap
.rustfmt.toml
.vpython3
.yapfignore
ATL_OWNERS
AUTHORS
BUILD.gn
CODE_OF_CONDUCT.md
DEPS
DIR_METADATA
LICENSE
LICENSE.chromium_os
OWNERS
PRESUBMIT.py
PRESUBMIT_test.py
PRESUBMIT_test_mocks.py
README.md
WATCHLISTS
codereview.settings

Bug: 826218 Change-Id: I176e1aeb0b24b21c6b4e5ee40910dce2bce52c95 Reviewed-on: https://chromium-review.googlesource.com/1239461 Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Daniel Bratell <bratell@opera.com> Cr-Commit-Position: refs/heads/master@{#593522}
128 lines
5.9 KiB
Markdown
128 lines
5.9 KiB
Markdown
# Vanilla msysgit workflow
|
|
|
|
This describes how you can use msysgit on Windows to work on the Chromium git
|
|
repository, without setting up Cygwin or hacking the `git cl`, `git try` and
|
|
other scripts to work under a regular Windows shell.
|
|
|
|
The basic setup is to set up a regular git checkout on a Linux (or Mac) box, and
|
|
use this exclusively to create your branches and run tools such as `git cl`, and
|
|
have your Windows box treat this git repository as its upstream.
|
|
|
|
The advantage is, you get a pretty clean setup on your Windows box that is
|
|
unlikely to break when the various custom git tools like `git cl` change. The
|
|
setup is also advantageous if you regularly build code on Windows and then want
|
|
to test it on Linux, since all you need to test on your Linux box is a `git
|
|
push` from Windows followed by building and testing under Linux.
|
|
|
|
The disadvantage is that it adds an extra layer between the Chromium git repo
|
|
and your Windows checkout. In my experience (joi@chromium.org) this does not
|
|
actually slow you down much, if at all.
|
|
|
|
The most frequently used alternative to this workflow on Windows seems to be
|
|
using Cygwin and creating a checkout directly according to the instructions at
|
|
UsingGit. The advantage of that approach is you lose the extra overhead, the
|
|
disadvantage seems to be mostly speed and having to run a Cygwin shell rather
|
|
than just a normal Windows cmd.
|
|
|
|
Please note that the instructions below are mostly from memory so they may be
|
|
slightly incorrect and steps may be missing. Please feel free to update the
|
|
page with corrections and additions based on your experience.
|
|
|
|
## Details
|
|
|
|
Create your checkouts:
|
|
|
|
1. Create a git checkout on your Linux box, with read/write abilities, as per
|
|
UsingGit. The rest of these instructions assume it is located at
|
|
/home/username/chrome
|
|
1. Install msysgit on your Windows box.
|
|
|
|
Starting a new topic branch:
|
|
|
|
1. Linux: `git branch mytopic`
|
|
(or you may want to use e.g. the LKGR script from UsingGit).
|
|
1. Windows: `git fetch` then `git checkout mytopic`
|
|
|
|
Normal workflow on Windows:
|
|
|
|
1. ...edit/add some files...
|
|
1. `git commit -a -m "my awesome change"`
|
|
1. ...edit more...
|
|
1. `git commit -a -m "follow-up awesomeness"`
|
|
1. `git push`
|
|
|
|
Normal workflow on Linux:
|
|
|
|
* (after `git push` from windows): `git cl upload && git try`
|
|
* (after LGTM and successful try): `git cl commit`
|
|
(but note the `tot-mytopic` trick in the pipelining section below)
|
|
|
|
Avoiding excessive file changes (to limit amount of Visual Studio rebuilds when
|
|
switching between branches):
|
|
|
|
* Base all your different topic branches off of the same base branch; I
|
|
generally create a new LKGR branch once every 2-3 working days and then `git
|
|
merge` it to all of my topic branches.
|
|
* To track which base branch topic branches are based off, you can use a
|
|
naming convention; I use e.g. lk0426 for an LKGR branch created April 26th,
|
|
then use e.g. lk0426-topic1, lk0426-topic2 for the topic branches that have
|
|
all changes merged from lk0426. I (joi@chromium.org) also have a script to
|
|
update the base branch for topic branches and rename them - let me know if
|
|
interested.
|
|
* Now that all your branch names are prefixed with the base revision (whether
|
|
you use my naming convention or not), you can know before hand when you
|
|
switch between branches on Windows whether you should expect a major
|
|
rebuild, or a minor rebuild. If you are able to remember which of your
|
|
topic branches have gn changes and which don't (or I guess you could use
|
|
`git diff` to figure this out), then you will also have a good idea whether
|
|
you need to run `gclient runhooks` or not when you switch branches. Another
|
|
nice thing is that you should never have to run `gclient sync` when you
|
|
switch between branches with the same base revision, unless some of your
|
|
branches have changes to DEPS files.
|
|
|
|
Pipelining:
|
|
|
|
1. Linux:
|
|
1. `git checkout lk0426-mytopic`
|
|
1. `git checkout -b lk0426-mytopic-nextstep`
|
|
1. Windows:
|
|
1. `git fetch && git checkout lk0426-mytopic-nextstep`
|
|
1. ...work as usual...
|
|
1. `git push`
|
|
1. Later, on Linux:
|
|
1. `make_new_lkgr_branch lk0428`
|
|
1. `git merge lk0428 lk0426-mytopic`
|
|
1. `git branch -m lk0426-mytopic lk0428-mytopic` (to rename)
|
|
1. `git merge lk0428-mytopic lk0426-mytopic-nextstep`
|
|
1. `git branch -m lk0428-mytopic-nextstep lk0428-mytopic-nextstep`
|
|
(to rename)
|
|
1. Later, when you want to commit one of the earlier changes in the pipeline;
|
|
all on Linux. The reason you may want to create the separate tip-of-tree
|
|
branch is in case the try bots show your change failing on tip-of-tree and
|
|
you need to do significant additional work, this avoids having to roll back
|
|
the tip-of-tree merge:
|
|
|
|
Janitorial work on Windows:
|
|
|
|
* When you rename branches on the Linux side, the Windows repo will not know
|
|
automatically; so if you already had a branch `lk0426-mytopic` open on
|
|
Windows and then `git fetch`, you will still have `lk0426-mytopic` even if
|
|
that was renamed on the Linux side to `lk0428-mytopic`.
|
|
* Dealing with this is straight-forward; you just
|
|
`git checkout lk0428-mytopic` to switch to the renamed (and likely updated)
|
|
branch. Then `git branch -d lk0426-mytopic` to get rid of the tracking
|
|
branch for the older name. Then, occasionally, `git remotes prune origin`
|
|
to prune remote tracking branches (you don't normally see these listed
|
|
unless you do `git branch -a`).
|
|
|
|
Gotchas:
|
|
|
|
* You should normally create your branches on Linux only, so that the Windows
|
|
repo gets tracking branches for them. Any branches you create in the
|
|
Windows repo would be local to that repository, and so will be non-trivial
|
|
to push to Linux.
|
|
* `git push` from Windows will fail if your Linux repo is checked out to the
|
|
same branch. It is easy to switch back manually, but I also have a script I
|
|
call `safepush` that switches the Linux-side branch for you before pushing;
|
|
let me (joi@chromium.org) know if interested.
|