summaryrefslogtreecommitdiffstats
path: root/llvm/utils/git-svn
Commit message (Collapse)AuthorAgeFilesLines
* git-llvm: Add option to push to Github with SSHValentin Churavy2019-12-161-4/+11
| | | | | | | | | | | | | | | | Summary: For users with 2FA Github password challenge can be rather cumbersome and I personally use key based authentication through SSH. This fixes the SSH feature that was present and exposes it as a command line option. Reviewers: tstellar Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71534
* git-llvm: Drop dependency on github moduleTom Stellard2019-10-251-11/+5
| | | | | This was required for blocking merge commits, but now that we have branch protections, we don't need this.
* git-llvm: Push to master branch by defaultTom Stellard2019-10-241-0/+1
| | | | | This allows pushing without specifying a branch, which is what the documentations says to do.
* Update git-llvm script to push to GitHubTom Stellard2019-10-221-433/+77
| | | | | | | | | | | | | | | | | | Summary: Note: This patch should not be pushed until SVN has become read-only. It should be the first patch committed directly to GitHub. This patch updates git-llvm to check for merge commits and then push changes to GitHub if none are found. All logic related to SVN has been removed. Reviewers: jyknight Subscribers: lenary, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67772
* [git-llvm] Do not reinvent `@{upstream}` (take 2)David Zarzycki2019-09-171-9/+9
| | | | | | | | | | | | This makes git-llvm more of a thin wrapper around git while temporarily maintaining backwards compatibility with past git-llvm behavior. Using @{upstream} makes git-llvm more robust when used with a nontrivial local repository. https://reviews.llvm.org/D67389 llvm-svn: 372070
* Add libc to path mappings in git-llvm.David L. Jones2019-09-161-0/+1
| | | | llvm-svn: 372048
* Revert [git-llvm] Do not reinvent `@{upstream}`Mehdi Amini2019-09-101-2/+12
| | | | | | | | | This reverts r371290 (git commit 7faffd544b16f851a632d6b8f93e3c8485ff34bb) The change wasnt NFC and broke some users' workflow. Reverting while figuring out the best alternative to move forward. llvm-svn: 371480
* [git-llvm] Do not reinvent `@{upstream}`David Zarzycki2019-09-071-12/+2
| | | | | | | | Make `git-llvm` more robust when used with a nontrivial repository. https://reviews.llvm.org/D67262 llvm-svn: 371290
* git-llvm: Make push --force suppress error on nothing to commit as wellNico Weber2019-08-211-5/+6
| | | | llvm-svn: 369544
* git-llvm: Give "push" a --force flag to disable confirm prompt on multiple ↵Nico Weber2019-08-211-1/+6
| | | | | | commits llvm-svn: 369538
* [util] Allow callsigns when running git llvm revertJordan Rupprecht2019-08-131-3/+3
| | | | llvm-svn: 368726
* Fixup r367321 "Ask confirmation when `git llvm push` will push multiple commits"Mehdi Amini2019-08-031-9/+4
| | | | | | | I unfortunately commited an obsolete revision in r367321 that didn't have all the changes the reviewers suggested. llvm-svn: 367761
* Fix git-llvm to not delete non-empty directories.James Y Knight2019-08-021-15/+42
| | | | | | | | | | | | | | | | | | | | | | | | Previously, if a directory contained only other sub-directories, one of which was being removed, git llvm would delete the parent and all its subdirs, even though only one should've been deleted. This error occurred in r366590, where the commit attempted to remove lldb/packages/Python/lldbsuite/test/tools/lldb-mi, but git-llvm erroneously removed the entire contents of lldb/packages/Python/lldbsuite/test/tools. This happened because "git apply" automatically removes empty directories locally, and the absence of a local directory was previously taken as an indication to call 'svn rm' on that directory. However, an empty local directory does not necessarily indicate that the directory is truly empty. Fix that by removing directories only when they're empty on the git side. Differential Revision: https://reviews.llvm.org/D65416 llvm-svn: 367693
* Ask confirmation when `git llvm push` will push multiple commitsMehdi Amini2019-07-301-0/+26
| | | | | | | | This can reduce unexpectedly pushing more than expected by the user. Differential Revision: https://reviews.llvm.org/D64893 llvm-svn: 367321
* Fix `git llvm` script when no arguments are supplied on Python 3Mehdi Amini2019-07-301-0/+9
| | | | | | | | | | Instead of displaying a help message, it was issuing an error message: AttributeError: 'Namespace' object has no attribute 'func' https://bugs.python.org/issue16308 has more information on the bug. llvm-svn: 367320
* git-llvm: Restore compatibility with git 1.8.3.James Y Knight2019-07-291-1/+1
| | | | llvm-svn: 367259
* Add location of SVN staging dir to git-llvm error outputStefan Granitz2019-07-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In pre-monorepo times the svn staging directory was `.git/svn`. The below error message wasn't mentioning the new name yet. Example before: ``` Can't push git rev 104cfa289d9 because svn status is not empty: ! llvm/trunk/include/llvm ``` Example after: ``` Can't push git rev 104cfa289d9 because status in svn staging dir (.git/llvm-upstream-svn) is not empty: ! llvm/trunk/include/llvm ``` Reviewers: mehdi_amini, jlebar, teemperor Reviewed By: mehdi_amini Subscribers: llvm-commits, #llvm Tags: #llvm Differential Revision: https://reviews.llvm.org/D65038 llvm-svn: 366671
* Remove username from git-llvm script, erroneously added in 366197Sam McCall2019-07-161-1/+1
| | | | llvm-svn: 366198
* [AArch64] Implement __jcvt intrinsic from Armv8.3-AKyrylo Tkachov2019-07-161-1/+1
| | | | | | | | | | | | | | | | The jcvt intrinsic defined in ACLE [1] is available when ARM_FEATURE_JCVT is defined. This change introduces the AArch64 intrinsic, wires it up to the instruction and a new clang builtin function. The __ARM_FEATURE_JCVT macro is now defined when an Armv8.3-A or higher target is used. I've implemented the target detection logic in Clang so that this feature is enabled for architectures from armv8.3-a onwards (so -march=armv8.4-a also enables this, for example). make check-all didn't show any new failures. [1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics Differential Revision: https://reviews.llvm.org/D64495 llvm-svn: 366197
* [GitSVN][NFC] Mark dry-run commits as such in the log outputJohannes Doerfert2019-07-141-2/+2
| | | | | | | | | | | | | | Summary: This helps to avoid worries about the "dry run flag" while testing. Reviewers: jyknight, rnk, mehdi_amini Subscribers: bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64697 llvm-svn: 366023
* Fix some minor coding-style issues in git-llvm.James Y Knight2019-07-121-32/+39
| | | | llvm-svn: 365918
* Allow the 'git-llvm' tool to push to svn from the split repositoriesJames Y Knight2019-07-121-14/+30
| | | | | | | | | for 'test-suite', 'lnt', 'zorg', and 'www'. This is done by looking at the pathname of the git remote named 'origin', which is not 100% reliable, but should work in most cases. llvm-svn: 365917
* [git] Be more specific when looking for llvm-svnJordan Rupprecht2019-05-231-13/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A commit may, for some reason, have `llvm-svn:` in it multiple times. It may even take up the whole line and look identical to what gets added automatically when svn commits land in github. To workaround this, make changes to both lookups: 1) When doing the git -> svn lookup, make sure to go through the whole message, and: a) Only look for llvm-svn starting at the beginning of the line (excluding the whitespace that `git log` adds). b) Take the last one (at the end of the commit message), if there are multiple matches. 2) When doing the svn -> git lookup, look through a sizeable but still reasonably small number of git commits (10k, about 4-5 months right now), and: a) Only consider commits with the '^llvm-svn: NNNNNN' we expect, and b) Only consider those that also follow the same git -> svn matching above. (Error if it's not exactly one commit). Reviewers: jyknight Reviewed By: jyknight Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60017 llvm-svn: 361532
* Make the git-llvm script work on older git versions that don't support git ↵Craig Topper2019-05-031-0/+5
| | | | | | | | | | | | | | | rev-parse --git-common-dir. Not all versions of git support git rev-parse --git-common-dir. Rather than erorr or print any kind of useful error, they just print back '--git-common-dir' instead of a directory. The git-llvm script ends up taking this '--git-common-dir' as a diretory name to use. Not sure exactly what happens after that, but the end result is that the 'git llvm push' ends up looking like it pushed your commits, but really did nothing. This patch makes the script detect the bogus directory name for --git-common-dir and falls back to using --git-dir instead. llvm-svn: 359939
* Add "git llvm revert" and "git llvm svn-lookup" subcommandsJordan Rupprecht2019-03-281-3/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current git-svnrevert script only works with git-svn repos (e.g. using "git svn find-rev" to find the commit to revert). This adds a similar implementation that works with the llvm git command handler. Usage: ``` // Revert by svn id $ git llvm revert r123456 // See what commands would be run instead of actually reverting $ git llvm revert -n r123456 <full git revert + git commit commands> // Git commit hash also fine $ git llvm revert abc123456 // For convenience, the git->svn method can be used directly: $ git llvm svn-lookup abc123456 r123456 // Push revert upstream (drop the -n when ready) $ git llvm push -n ``` Regardless of how the command is invoked (with a svn revision or git hash), the message is: ``` Revert [LibFoo] Change Foo implementation This reverts r123456 (git commit abc123) ``` Reviewers: jyknight, mehdi_amini, jlebar Reviewed By: jlebar Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59837 llvm-svn: 357180
* Fix git-llvm crashing when trying to remove directory while cleaningRaphael Isemann2019-03-121-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I'm trying to push D59198 but it seems that `git-llvm push` can't handle the fact that I add a new directory in the patch: ``` > git llvm push -n Pushing 1 commit: e7c0a9bd136 Correctly look up declarations in inline namespaces Traceback (most recent call last): File "llvm/utils/git-svn//git-llvm", line 431, in <module> args.func(args) File "llvm/utils/git-svn//git-llvm", line 385, in cmd_push clean_svn(svn_root) File "llvm/utils/git-svn//git-llvm", line 201, in clean_svn os.remove(os.path.join(svn_repo, filename)) IsADirectoryError: [Errno 21] Is a directory: '.git/llvm-upstream-svn/lldb/trunk/packages/Python/lldbsuite/test/expression_command/inline-namespace' ``` This patch just uses shutil to delete the directory instead of trying to use `os.remove` which only works for files. Reviewers: mehdi_amini, jlebar Reviewed By: jlebar Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59236 llvm-svn: 355896
* [git-llvm] Only use --force-interactive when supportedShoaib Meenai2019-03-101-1/+4
| | | | | | | | | | | | | | | | | | The --force-interactive option was introduced in SVN 1.8, and trying to pass it to older SVN clients causes an error; CentOS 7 includes SVN 1.7, for example, so this makes `git llvm` not usable out of the box. Older clients would be interactive by default anyway [1], so just don't pass the option if it's not supported. An alternative would be to check the version instead of checking the help text, but I think directly detecting the presence of the option is more direct. [1] http://svn.apache.org/viewvc?view=revision&revision=1424037 Differential Revision: https://reviews.llvm.org/D59161 llvm-svn: 355782
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* git-llvm: Fix incremental population of svn tree.James Y Knight2018-11-291-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "svn update --depth=..." is, annoyingly, not a specification of the desired depth, but rather a _limit_ added on top of the "sticky" depth in the working-directory. However, if the directory doesn't exist yet, then it sets the sticky depth of the new directory entries. Unfortunately, the svn command-line has no way of expanding the depth of a directory from "empty" to "files", without also removing any already-expanded subdirectories. The way you're supposed to increase the depth of an existing directory is via --set-depth, but --set-depth=files will also remove any subdirs which were already requested. This change avoids getting into the state of ever needing to increase the depth of an existing directory from "empty" to "files" in the first place, by: 1. Use svn update --depth=files, not --depth=immediates. The latter has the effect of checking out the subdirectories and marking them as depth=empty. The former excludes sub-directories from the list of entries, which avoids the problem. 2. Explicitly populate missing parent directories. Using --parents seemed nice and easy, but it marks the parent dirs as depth=empty. Instead, check out parents explicitly if they're missing. llvm-svn: 347883
* llvm-git: More tweaks.James Y Knight2018-11-281-36/+19
| | | | | | | | | | | | On python3, use bytes for reading and applying the patch file, rather than str. This fixes encoding issues when applying patches with python3.X (reported by zturner). Also, simplify and speed up "svn update" via svn's "--parents" argument, instead of manually computing and supplying the list of parent directories to update. llvm-svn: 347766
* Make git-llvm python3 compatible again. Hopefully. :)James Y Knight2018-11-161-4/+13
| | | | llvm-svn: 347113
* Speed up git-llvm script by only svn up'ing affected directories.James Y Knight2018-11-161-30/+72
| | | | | | | | | Also, support modifications to toplevel files in git (which need to be committed to "monorepo-root" in svn). Differential Revision: https://reviews.llvm.org/D54341 llvm-svn: 347103
* [git-llvm] Fix some issues surrouding EOL conversion on Windows.Zachary Turner2018-10-091-9/+19
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes three issues. The first is that we didn't consider files which are explicitly set to eolstyle CRLF in the repo, and there are a handful of these. Second is that dos2unix doesn't have a -q option in GnuWin32, so this codepath wasn't working properly. Finally with newer versions of Python (or newer versions of Git, or some combination of the two) patches can't be applied when we treat stdin as text, because Python silently undoes all the work we did to convert the newlines to LF using dos2unix by using universal_newlines=True and then converting them *back* to CRLF. So we need to add a way to force stdin to be treated as binary, and use it when LF-newlines are required. Differential Revision: https://reviews.llvm.org/D51444 llvm-svn: 344095
* [git-llvm] Handle files ignored by svn correctlyWalter Lee2017-12-221-5/+6
| | | | | | | | | | Summary: Correctly handle files ignored by svn (such as .o files, which are ignored by default) by adding "--no-ignore" flag to "svn status" and "svn add". Differential Revision: https://reviews.llvm.org/D41404 llvm-svn: 321388
* [git] Update the llvm git helper script to work correctly with theChandler Carruth2017-09-161-1/+1
| | | | | | latest Python versions. llvm-svn: 313435
* Revert r305598, "utils: Add a git-r utility for mapping svn revisions to git ↵Peter Collingbourne2017-06-191-169/+0
| | | | | | | | | | | revisions in the monorepo." $ git revert `git r 305598` We need to decide whether we want development tools to be written in Go first. llvm-svn: 305741
* utils: Add a git-r utility for mapping svn revisions to git revisions in the ↵Peter Collingbourne2017-06-161-0/+169
| | | | | | monorepo. llvm-svn: 305598
* git-llvm: Update the project list for the llvm-project-20170507 monorepo.Peter Collingbourne2017-06-041-0/+5
| | | | llvm-svn: 304691
* git-llvm script should add .exe on Windows.Zachary Turner2017-05-241-0/+2
| | | | llvm-svn: 303708
* [git-llvm] Check if svn is installed.Rui Ueyama2017-05-231-0/+8
| | | | | | | | | | | | | The error message that git-llvm script prints out when svn is missing is very cryptic. I spent a fair amount of time to find what was wrong with my environment. It looks like many newcomers also exprienced a hard time to submit their first patches due to this error. This patch adds a more user-friendly error message. Differential Revision: https://reviews.llvm.org/D33458 llvm-svn: 303696
* [git-llvm] Don't attempt to propget files that don't exist yet in SVNReid Kleckner2017-05-181-0/+2
| | | | | | svn propget will fail halfway through, and the patch will fail to apply. llvm-svn: 303359
* [git-llvm] Fix svn:eol-style issue for one-file patchesReid Kleckner2017-05-121-14/+19
| | | | llvm-svn: 302853
* [git-llvm] Remove CR from middle of svn propget outputReid Kleckner2017-04-241-0/+2
| | | | llvm-svn: 301268
* [git-llvm] Make `push` work on CRLF files with svn:eol-style=nativeReid Kleckner2017-04-241-7/+60
| | | | | | | | | | | | | | | | | | | | | | Summary: `git apply` on Windows doesn't work for files that SVN checks out as CRLF. There is no way to force SVN to check everything out with Unix line endings on Windows. Files with svn:eol-style=native will always come out with CRLF, breaking `git apply`, which wants Unix line endings. My workaround is to list all files with this property set in the change, and run `dos2unix` on them. SVN doesn't commit a massive line ending change because the svn:eol-style property indicates that these are text files. Tested on r301245. Reviewers: zturner, jlebar Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32452 llvm-svn: 301262
* Remove extraneous space.Rui Ueyama2016-12-201-1/+1
| | | | llvm-svn: 290165
* [git-llvm] Use --force-interactive when commiting to enable SVN to prompt ↵Mehdi Amini2016-11-301-1/+1
| | | | | | | | | | | | | password When svn does not know the password and it has to prompt, it needs to query. However it won't when invoked from the Python script and instead fails with: svn: E215004: Authentication failed and interactive prompting is disabled; see the --force-interactive option Differential Revision: https://reviews.llvm.org/D27274 llvm-svn: 288266
* Improve `git llvm push` to suggest `git pull` when applying patch failsMehdi Amini2016-11-121-4/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D26565 llvm-svn: 286695
* Fix `git-llvm` script to handle `git worktree` setups correctlyMehdi Amini2016-11-071-1/+2
| | | | llvm-svn: 286140
* Add some facilities to work with a git monorepo (experimental setup)Mehdi Amini2016-11-071-0/+278
| | | | | | | | | | | | | | | Add a new script in llvm/utils/git-svn/. When present in the $PATH, it enables a `git llvm` command. It is providing at this point only the ability to push from the git monorepo: `git llvm push`. It is intended to evolves with more features, for instance I plan on features like `git llvm show r284955` to help working with sequential revision numbers. The push feature is taken from Justin Lebar's script available here: https://github.com/jlebar/llvm-repo-tools/ Differential Revision: https://reviews.llvm.org/D26334 llvm-svn: 286138
* Revert "Add some facilities to work with a git monorepo (experimental setup)"Mehdi Amini2016-11-071-296/+0
| | | | | | This reverts commit r286123, accidentally commited while testing itself... llvm-svn: 286124
OpenPOWER on IntegriCloud