Skip to content

Commit

Permalink
Switch dev refs to main (#982)
Browse files Browse the repository at this point in the history
Removed all references to the dev branch from scripts, docs and tests.
  • Loading branch information
hugsy committed Aug 7, 2023
1 parent 8f0f444 commit 878cbf2
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ By contributing to `gef` code through the _Pull Requests_ mechanism, you accept
* Comment your code
* If you add a new feature/GDB command, also write the adequate
documentation (in [`docs/`](docs/))
1. Submit a pull request, **make sure it is made against the `dev` branch (not `main`, which only contains tested and stable features)**
1. Submit a pull request, make sure it is made against the `main` branch
1. The contributors will review your patch. If it is approved, the change will
be merged via the GitHub, and you will be seen as contributors. If it needs
additional work, the repo owner will respond with useful comments.
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

<!-- N.B.: Your patch won't be reviewed unless fulfilling the following base requirements: -->
<!--- Put an `x` in all the boxes that are complete, or that don't apply -->
- [ ] My PR was done against the `dev` branch, not `main`.
- [ ] My code follows the code style of this project.
- [ ] My change includes a change to the documentation, if required.
- [ ] If my change adds new code, [adequate tests](docs/testing.md) have been added.
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:

push:
branches:
- dev
- main

jobs:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ on:
push:
branches:
- main
- dev

pull_request:
types:
- opened
- closed
branches:
- main
- dev

env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ on:
push:
branches:
- main
- dev

pull_request:
branches:
- main
- dev

jobs:
build:
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ $ gdb -q
(gdb) pi import urllib.request as u, tempfile as t; g=t.NamedTemporaryFile(suffix='-gef.py'); open(g.name, 'wb+').write(u.urlopen('https:https://tinyurl.com/gef-main').read()); gdb.execute('source %s' % g.name)
```

_Note_: to fetch the latest of GEF (i.e. from the `dev` branch), simply replace in the URL to
https://gef.blah.cat/dev.

You can immediately see that GEF is correctly installed by launching GDB:

![gef-context](https://i.imgur.com/E3EuQPs.png)
Expand All @@ -61,7 +58,7 @@ d more comprehensible layout to GDB Python API.
* Built around an architecture abstraction layer, so all commands work in any GDB-supported
architecture such as x86-32/64, ARMv5/6/7, AARCH64, SPARC, MIPS, PowerPC, etc.
* Suited for real-life apps debugging, exploit development, just as much as CTF
* And a lot more commands contributed by the community available on
* And a lot more commands contributed by the community available on
[GEF-Extras](https://github.com/hugsy/gef-extras) !!

Check out the [Screenshot page](docs/screenshots.md) for more or [try it
Expand All @@ -79,16 +76,16 @@ try to reach out for help on the Discord channel or submit an issue.

## Current status ##

| Documentation |License | Compatibility | CI Tests (`main`) | CI Tests (`dev`) |
|:---:|:---:|:---|--|--|
| [![Documentation](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml) | [![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic)](https://github.com/hugsy/gef/blob/main/LICENSE) | [![Python 3](https://img.shields.io/badge/Python-3-green.svg)](https://github.com/hugsy/gef/) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/run-tests.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/run-tests.yml/badge.svg?branch=dev)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) |
| Documentation |License | Compatibility | CI Tests (`main`) |
|:---:|:---:|:---|--|
| [![Documentation](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/generate-docs.yml) | [![MIT](https://img.shields.io/packagist/l/doctrine/orm.svg?maxAge=2592000?style=plastic)](https://github.com/hugsy/gef/blob/main/LICENSE) | [![Python 3](https://img.shields.io/badge/Python-3-green.svg)](https://github.com/hugsy/gef/) | [![CI Test for GEF](https://github.com/hugsy/gef/actions/workflows/run-tests.yml/badge.svg)](https://github.com/hugsy/gef/actions/workflows/run-tests.yml) |


## Contribute ##

To get involved, refer to the [Contribution
documentation](https://hugsy.github.io/gef/#contribution) and the
[guidelines](https://github.com/hugsy/gef/blob/dev/.github/CONTRIBUTING.md) to start.
[guidelines](https://github.com/hugsy/gef/blob/main/.github/CONTRIBUTING.md) to start.

## Sponsors ##

Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ args.blah --> True # set to True because user input declared the option (would h
### Adding new architectures

Support for new architectures can be added by inheriting from the `Architecture` class. Examples can
be found in [gef-extras](https://github.com/hugsy/gef-extras/tree/dev/archs).
be found in [gef-extras](https://github.com/hugsy/gef-extras/tree/main/archs).

Sometimes architectures can more precisely determine whether they apply to the current target by
looking at the architecture determined by gdb. For these cases the custom architecture may implement
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/gef.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ looks up for script names in the `main` branch of `gef-extras`. However you can
different branch through the `gef.default_branch` configuration setting:

```
gef➤ gef config gef.default_branch dev
gef➤ gef config gef.default_branch my_other_branch
```

The files will be dowloaded in the path configured in the `gef.extra_plugins_dir` setting, allowing
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/pcustom.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ currently debugged binary, the architecture, the size of a pointer and more).
The syntax is relatively close to the way we use to create static classes (see above), but instead
we define a function that will generate the class. The requirements for this class factory are:

- take a single [`Gef`](https://github.com/hugsy/gef/blob/dev/docs/api/gef.md#class-gef) positional
- take a single [`Gef`](https://github.com/hugsy/gef/blob/main/docs/api/gef.md#class-gef) positional
argument
- End the function name with `_t`

Expand Down
20 changes: 10 additions & 10 deletions docs/deprecated.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ page aims to track those changes.

| Command | Status | Since | Link (if Applicable) | Notes |
|--|--|--|--|--|
| `cs-disassemble` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/trinity/capstone.py) | Depends on `capstone` |
| `assemble` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/trinity/assemble.py) | Depends on `keystone` |
| `emulate` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/trinity/unicorn.py) | Depends on `unicorn` and `capstone` |
| `set-permission` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/trinity/mprotect.py) | Depends on `keystone` |
| `ropper` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/ropper.py) | Depends on `ropper` |
| `ida-interact` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/ida_interact.py) | Depends on `rpyc` |
| `exploit-template` | Moved | [c402900](https://github.com/hugsy/gef-extras/commit/c4029007994d5e508cb3df900b60821b0b61e0e5) | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/skel.py) | |
| `windbg` | Moved | [a933a5a](https://github.com/hugsy/gef-extras/commit/a933a5ac43933742d91f4e299eadf05e3e0670be) | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/windbg.py) | |
| `is-syscall` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/syscall_args) | |
| `syscall-args` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/dev/scripts/syscall_args) | |
| `cs-disassemble` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/trinity/capstone.py) | Depends on `capstone` |
| `assemble` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/trinity/assemble.py) | Depends on `keystone` |
| `emulate` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/trinity/unicorn.py) | Depends on `unicorn` and `capstone` |
| `set-permission` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/trinity/mprotect.py) | Depends on `keystone` |
| `ropper` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/ropper.py) | Depends on `ropper` |
| `ida-interact` | Moved | 2022.06 | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/ida_interact.py) | Depends on `rpyc` |
| `exploit-template` | Moved | [c402900](https://github.com/hugsy/gef-extras/commit/c4029007994d5e508cb3df900b60821b0b61e0e5) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/skel.py) | |
| `windbg` | Moved | [a933a5a](https://github.com/hugsy/gef-extras/commit/a933a5ac43933742d91f4e299eadf05e3e0670be) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/windbg.py) | |
| `is-syscall` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |
| `syscall-args` | Moved | [3f79fb38](https://github.com/hugsy/gef-extras/commit/3f79fb382aa9052d073698d40237f98982c5d2de) | [Link](https://github.com/hugsy/gef-extras/blob/main/scripts/syscall_args) | |
16 changes: 2 additions & 14 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Prerequisites

Specific GEF commands rely on commonly used Unix commands to extract additional information.
Specific GEF commands rely on commonly used Unix commands to extract additional information.
Therefore it requires the following binaries to be present:

* `file`
Expand Down Expand Up @@ -99,22 +99,10 @@ updates are available, `gef` will respond `No update` instead.
To contribute to GEF, you might prefer using git directly.

```bash
git clone --branch dev https://github.com/hugsy/gef.git
git clone https://github.com/hugsy/gef.git
echo source `pwd`/gef/gef.py >> ~/.gdbinit
```

GEF is in very active development, so the default branch is `dev`. This is the
branch you must use if you intend to submit pull requests.

However if you prefer a more stable life, you can then switch to the `main`
branch:

```bash
git checkout main
```

The `main` branch gets only updated for new releases, or also when critical
fixes occur and need to be patched urgently.

## Community repository: GEF-Extras

Expand Down
2 changes: 1 addition & 1 deletion gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def http_get(url: str) -> Optional[bytes]:
def update_gef(argv: List[str]) -> int:
"""Try to update `gef` to the latest version pushed on GitHub main branch.
Return 0 on success, 1 on failure. """
ver = "dev" if "--dev" in argv else GEF_DEFAULT_BRANCH
ver = GEF_DEFAULT_BRANCH
latest_gef_data = http_get(f"https://raw.githubusercontent.com/hugsy/gef/{ver}/scripts/gef.sh")
if not latest_gef_data:
print("[-] Failed to get remote gef")
Expand Down
2 changes: 1 addition & 1 deletion scripts/gef-extras.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
set -e

usage() { echo "Usage: $0 [-b <main|dev>] [-p <path_to_install>]" 1>&2; exit 1; }
usage() { echo "Usage: $0 [-b <main|OtherBranchName>] [-p <path_to_install>]" 1>&2; exit 1; }

branch="main"
while getopts ":b:p:" o; do
Expand Down
5 changes: 0 additions & 5 deletions scripts/gef.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
set -e

branch="main"
if [ "$1" = "dev" ]; then
branch="dev"
echo "set branch to dev"
fi

curl_found=0
wget_found=0

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-api-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
gef_root=$(dirname "$script_dir")
output_path="${gef_root}/docs/api/"
src_base_url="https://github.com/hugsy/gef/blob/dev/"
src_base_url="https://github.com/hugsy/gef/blob/main/"
full_doc_path="${gef_root}/docs/api/gef.md"

check()
Expand Down
2 changes: 1 addition & 1 deletion tests/api/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def test_func_parse_maps(self):
@pytest.mark.skip
def test_func_update_gef(self):
bkp_home = os.environ["HOME"]
for branch in ("main", "dev"):
for branch in ("main", ):
with tempfile.TemporaryDirectory() as tmpdir:
dirpath = pathlib.Path(tmpdir)
os.environ["HOME"] = str(dirpath.absolute())
Expand Down

0 comments on commit 878cbf2

Please sign in to comment.