rescue

Insects Are ‘Glue in Nature’ and Must Be Rescued to Save Humanity, Says Top Scientist

By Jake Johnson Common Dreams Rapidly falling insect populations, said Anne Sverdrup-Thygeson, “will make it even more difficult than today to get enough food for the human population of the planet, to get good health and freshwater for everybody.” A … Continue reading




rescue

Insects Are ‘Glue in Nature’ and Must Be Rescued to Save Humanity, Says Top Scientist

By Jake Johnson Common Dreams Rapidly falling insect populations, said Anne Sverdrup-Thygeson, “will make it even more difficult than today to get enough food for the human population of the planet, to get good health and freshwater for everybody.” A … Continue reading




rescue

Committed to the wrong branch? -, @{upstream}, and @{-1} to the rescue

I get into this situation sometimes. Maybe you do too. I merge feature work into a branch used to collect features, and then continue development but on that branch instead of back on the feature branch

git checkout feature
# ... bunch of feature commits ...
git push
git checkout qa-environment
git merge --no-ff --no-edit feature
git push
# deploy qa-environment to the QA remote environment
# ... more feature commits ...
# oh. I'm not committing in the feature branch like I should be

and have to move those commits to the feature branch they belong in and take them out of the throwaway accumulator branch

git checkout feature
git cherry-pick origin/qa-environment..qa-environment
git push
git checkout qa-environment
git reset --hard origin/qa-environment
git merge --no-ff --no-edit feature
git checkout feature
# ready for more feature commits

Maybe you prefer

git branch -D qa-environment
git checkout qa-environment

over

git checkout qa-environment
git reset --hard origin/qa-environment

Either way, that works. But it'd be nicer if we didn't have to type or even remember the branches' names and the remote's name. They are what is keeping this from being a context-independent string of commands you run any time this mistake happens. That's what we're going to solve here.

Shorthands for longevity

I like to use all possible natively supported shorthands. There are two broad motivations for that.

  1. Fingers have a limited number of movements in them. Save as many as possible left late in life.
  2. Current research suggests that multitasking has detrimental effects on memory. Development tends to be very heavy on multitasking. Maybe relieving some of the pressure on quick-access short term memory (like knowing all relevant branch names) add up to leave a healthier memory down the line.

First up for our scenario: the - shorthand, which refers to the previously checked out branch. There are a few places we can't use it, but it helps a lot:

Bash
# USING -

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit -        # ????
git push
# hack hack hack
# whoops
git checkout -        # now on feature ???? 
git cherry-pick origin/qa-environment..qa-environment
git push
git checkout - # now on qa-environment ????
git reset --hard origin/qa-environment
git merge --no-ff --no-edit -        # ????
git checkout -                       # ????
# on feature and ready for more feature commits
Bash
# ORIGINAL

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit feature
git push
# hack hack hack
# whoops
git checkout feature
git cherry-pick origin/qa-environment..qa-environment
git push
git checkout qa-environment
git reset --hard origin/qa-environment
git merge --no-ff --no-edit feature
git checkout feature
# ready for more feature commits

We cannot use - when cherry-picking a range

> git cherry-pick origin/-..-
fatal: bad revision 'origin/-..-'

> git cherry-pick origin/qa-environment..-
fatal: bad revision 'origin/qa-environment..-'

and even if we could we'd still have provide the remote's name (here, origin).

That shorthand doesn't apply in the later reset --hard command, and we cannot use it in the branch -D && checkout approach either. branch -D does not support the - shorthand and once the branch is deleted checkout can't reach it with -:

# assuming that branch-a has an upstream origin/branch-a
> git checkout branch-a
> git checkout branch-b
> git checkout -
> git branch -D -
error: branch '-' not found.
> git branch -D branch-a
> git checkout -
error: pathspec '-' did not match any file(s) known to git

So we have to remember the remote's name (we know it's origin because we are devoting memory space to knowing that this isn't one of those times it's something else), the remote tracking branch's name, the local branch's name, and we're typing those all out. No good! Let's figure out some shorthands.

@{-<n>} is hard to say but easy to fall in love with

We can do a little better by using @{-<n>} (you'll also sometimes see it referred to be the older @{-N}). It is a special construct for referring to the nth previously checked out ref.

> git checkout branch-a
> git checkout branch-b
> git rev-parse --abbrev-rev @{-1} # the name of the previously checked out branch
branch-a
> git checkout branch-c
> git rev-parse --abbrev-rev @{-2} # the name of branch checked out before the previously checked out one
branch-a

Back in our scenario, we're on qa-environment, we switch to feature, and then want to refer to qa-environment. That's @{-1}! So instead of

git cherry-pick origin/qa-environment..qa-environment

We can do

git cherry-pick origin/qa-environment..@{-1}

Here's where we are (🎉 marks wins from -, 💥 marks the win from @{-1})

Bash
# USING - AND @{-1}

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit -                # ????
git push
# hack hack hack
# whoops
git checkout -                               # ????
git cherry-pick origin/qa-environment..@{-1} # ????
git push
git checkout -                               # ????
git reset --hard origin/qa-environment
git merge --no-ff --no-edit -                # ????
git checkout -                               # ????
# ready for more feature commits
Bash
# ORIGINAL

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit feature
git push
# hack hack hack
# whoops
git checkout feature
git cherry-pick origin/qa-environment..qa-environment
git push
git checkout qa-environment
git reset --hard origin/qa-environment
git merge --no-ff --no-edit feature
git checkout feature
# ready for more feature commits

One down, two to go: we're still relying on memory for the remote's name and the remote branch's name and we're still typing both out in full. Can we replace those with generic shorthands?

@{-1} is the ref itself, not the ref's name, we can't do

> git cherry-pick origin/@{-1}..@{-1}
origin/@{-1}
fatal: ambiguous argument 'origin/@{-1}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

because there is no branch origin/@{-1}. For the same reason, @{-1} does not give us a generalized shorthand for the scenario's later git reset --hard origin/qa-environment command.

But good news!

Do @{u} @{push}

@{upstream} or its shorthand @{u} is the remote branch a that would be pulled from if git pull were run. @{push} is the remote branch that would be pushed to if git push was run.

> git checkout branch-a
Switched to branch 'branch-a'
Your branch is ahead of 'origin/branch-a' by 3 commits.
  (use "git push" to publish your local commits)
> git reset --hard origin/branch-a
HEAD is now at <the SHA origin/branch-a is at>

we can

> git checkout branch-a
Switched to branch 'branch-a'
Your branch is ahead of 'origin/branch-a' by 3 commits.
  (use "git push" to publish your local commits)
> git reset --hard @{u}                                # <-- So Cool!
HEAD is now at <the SHA origin/branch-a is at>

Tacking either onto a branch name will give that branch's @{upstream} or @{push}. For example

git checkout branch-a@{u}

is the branch branch-a pulls from.

In the common workflow where a branch pulls from and pushes to the same branch, @{upstream} and @{push} will be the same, leaving @{u} as preferable for its terseness. @{push} shines in triangular workflows where you pull from one remote and push to another (see the external links below).

Going back to our scenario, it means short, portable commands with a minimum human memory footprint. (🎉 marks wins from -, 💥 marks the win from @{-1}, 😎 marks the wins from @{u}.)

Bash
# USING - AND @{-1} AND @{u}

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit -    # ????
git push
# hack hack hack
# whoops
git checkout -                   # ????
git cherry-pick @{-1}@{u}..@{-1} # ????????
git push
git checkout -                   # ????
git reset --hard @{u}            # ????
git merge --no-ff --no-edit -    # ????
git checkout -                   # ????
# ready for more feature commits
Bash
# ORIGINAL

git checkout feature
# hack hack hack
git push
git checkout qa-environment
git merge --no-ff --no-edit feature
git push
# hack hack hack
# whoops
git checkout feature
git cherry-pick origin/qa-environment..qa-environment
git push
git checkout qa-environment
git reset --hard origin/qa-environment
git merge --no-ff --no-edit feature
git checkout feature
# ready for more feature commits

Make the things you repeat the easiest to do

Because these commands are generalized, we can run some series of them once, maybe

git checkout - && git reset --hard @{u} && git checkout -

or

git checkout - && git cherry-pick @{-1}@{u}.. @{-1} && git checkout - && git reset --hard @{u} && git checkout -

and then those will be in the shell history just waiting to be retrieved and run again the next time, whether with CtrlR incremental search or history substring searching bound to the up arrow or however your interactive shell is configured. Or make it an alias, or even better an abbreviation if your interactive shell supports them. Save the body wear and tear, give memory a break, and level up in Git.

And keep going

The GitHub blog has a good primer on triangular workflows and how they can polish your process of contributing to external projects.

The FreeBSD Wiki has a more in-depth article on triangular workflow process (though it doesn't know about @{push} and @{upstream}).

The construct @{-<n>} and the suffixes @{push} and @{upstream} are all part of the gitrevisions spec. Direct links to each:



    • Code
    • Front-end Engineering
    • Back-end Engineering

    rescue

    AutoSOS: Towards Multi-UAV Systems Supporting Maritime Search and Rescue with Lightweight AI and Edge Computing. (arXiv:2005.03409v1 [cs.RO])

    Rescue vessels are the main actors in maritime safety and rescue operations. At the same time, aerial drones bring a significant advantage into this scenario. This paper presents the research directions of the AutoSOS project, where we work in the development of an autonomous multi-robot search and rescue assistance platform capable of sensor fusion and object detection in embedded devices using novel lightweight AI models. The platform is meant to perform reconnaissance missions for initial assessment of the environment using novel adaptive deep learning algorithms that efficiently use the available sensors and computational resources on drones and rescue vessel. When drones find potential objects, they will send their sensor data to the vessel to verity the findings with increased accuracy. The actual rescue and treatment operation are left as the responsibility of the rescue personnel. The drones will autonomously reconfigure their spatial distribution to enable multi-hop communication, when a direct connection between a drone transmitting information and the vessel is unavailable.




    rescue

    Fire-resistant rescue blanket

    A fire-resistant rescue blanket sized to underlay and wrap around a victim for protecting the victim from fire-related injuries. The fire-resistant rescue blanket includes layers of a flame-resistant material for protecting against fire injuries, a heat-reflective fabric for protecting against environmental heat conditions, and a protective fabric for protecting against fallen debris. The heat-reflective fabric is arranged along an inner surface of the flame-resistant material and contacts the victim when the victim is wrapped in the fire-resistant rescue blanket. The protective fabric is arranged on the opposing outer surface covering at least underneath the area where the victim is laying to protect the wrapped victim against debris, such as during a dragging operation. The fire-resistant rescue blanket includes a plurality of loop handles for allowing rescue personnel to carry the victim if necessary. A drag strap may also be attached to the fire-resistant rescue blanket for facilitating a dragging operation.




    rescue

    On-board rescue device for a ship

    The rescue device for the passengers and crew of a ship includes: a container that contains survival equipment; a system that is intended for stowing said container relative to the deck of the ship and contains at least one strap and a system for multimodally attaching and releasing said container; an airbag-type inflatable balloon set up between a structure, secured to the deck, and said container, said structure defining a passage for the passengers when needed; and a means for releasing the airbag set up on the wheelhouse of said ship. The frame-shaped structure is formed of: two side posts; a lower cradle, on which said container rests; an upper crosspiece; and a plate set up inside the ship and acting as a counterbearing for the airbag when said container is ejected.




    rescue

    Helicopter launched over Solent to rescue injured sailor

    A HELICOPTER has launched over the Solent to rescue an injured sailor.




    rescue

    Helicopter launched over Solent to rescue injured sailor

    A HELICOPTER has launched over the Solent to rescue an injured sailor.




    rescue

    West End resident rescued by emergency services using stretcher

    A HAMPSHIRE resident has been rescued from their home by emergency services.




    rescue

    Writing As Rescue, Reading As Escape: Writers On Creativity In Quarantine

    “Writers write.” “Publish or perish.” Even without a global pandemic, writers face constant pressure to produce new material. But for the first-time novelist, publishing a book when bookstores are closed for browsing, signings and readers is particularly tough.




    rescue

    Cajun Navy Volunteer Rescuer On Responding To Storm

    Copyright 2018 NPR. To see more, visit SCOTT SIMON, HOST: And Tropical Storm Florence continues to drench the Carolinas. There's flooding, downed trees and buckled roads. Trillions of gallons of water have come down as rain. Nearly a million people are without power. At least five deaths have been linked to the storm. And, of course, rescue efforts are underway at this moment. Todd Terrell is with the Cajun Navy, a volunteer rescue group, and he joins us from Wilmington, N.C. Mr. Terrell, Captain Terrell - whatever I call you - thanks so much for being with us. TODD TERRELL: Yes, sir. Thank y'all for having me. SIMON: And what are you seeing? How bad is this? And you have seen a lot. TERRELL: We've seen a lot. Last night, honestly, was about the scariest part I've been with a group of volunteers, even though it wasn't the worst weather we went through. In Wilmington, we - I guess, we caught the tail end of it. And as it came through here, they had some straight-line winds came through





    rescue

    Durables cos helplines, videos come to rescue

    Brands including Godrej, Panasonic, Samsung are now extending video consultations and helplines to serve a fraction of the complaints that can be solved over guided videos or calls. The brands are reaching out to customers through social media or through remote assist helplines.




    rescue

    Tried and tested: Ishga Hydrating Hand Cream has truly rescued my hands from the pandemic

    Like everyone else, my hands have taking a true beating from hand sanitiser, hand wash and cleaning products throughout this pandemic.




    rescue

    Rescued from the Wrath of the Dragon

    Liling desperately searched for truth on the Internet in the heart of the world’s largest atheistic country. Yet even there, she found Amazing Facts and soon became a joyful, baptized believer in Christ—all thanks to loving gifts from people like you! Will you help thousands and thousands more discover Bible truth and be ready for Jesus’ soon return?




    rescue

    U.S. Loan Proposed to Rescue Alaska Power Plant

    Years ago, the federal government spent $117 million on an experimental "clean coal" power plant in Alaska designed to generate electricity with a minimum of air pollution -- but the project never got up and running.




    rescue

    Bob Pickersgill was a station hand at Bonnie Doon when he rescued the family's three-year-old daughter from a fire




    rescue

    Rescued divers say they were surrounded by sharks while spearfishing near Augusta

    Three spearfishing teenage divers sought refuge on a reef for an hour waiting to be rescued after bronze whaler sharks began circling them.




    rescue

    World record-holding sailor Jon Sanders blames 'huge, confused swell' after rescue off WA coast

    Renowned sailor Jon Sanders blames a "huge, confused swell" for the sinking his yacht off the coast of WA.




    rescue

    Peregian Beach man rescued from bushfire thanks officers after close call

    The dramatic rescue of 94-year-old Andrew Michael from the Peregian Beach firestorm on Monday was captured on video. He's now returned home and says his rescuers did "a very good job".




    rescue

    Juvenile whale rescued off Queensland's Sunshine Coast



    • ABC Sunshine Coast
    • sunshine
    • Law
    • Crime and Justice:Animal Welfare:All
    • Australia:QLD:Noosa Heads 4567

    rescue

    Baby whale rescued off Sunshine Coast after becoming trapped in nets

    A delicate rescue operation frees a baby humpback from shark nets off Noosa on the Sunshine Coast with the whale's mother staying close to her calf during the ordeal.




    rescue

    Fish kill rescue plan needs to remove fish from Darling River urgently, say Menindee locals

    Menindee residents say the New South Wales Government is moving too slowly to prevent the loss of important native fish breeding stock in the Darling River, as authorities warn of further large-scale fish kills in to summer.




    rescue

    Thousands of fish rescued after being trapped in NSW dam for almost two years

    Thousands of fish which became trapped in a NSW pond after flooding in 2016 have been returned to the Macquarie River after a painstaking effort to keep them alive.




    rescue

    Queensland police rescue an elderly woman who had fallen and was trapped in her home for days

    The 80-year-old from Beaudesert broke her hip and was unable to move for more than four days.




    rescue

    Fears rescue horses will be euthanased as coronavirus dries up business

    Owners of a Tasmanian equestrian facility say they may have no other option as business evaporates, leaving it with dwindling resources to feed and keep 46 horses.




    rescue

    As more fish kills loom this summer, NSW Government plans $10 million rescue and restocking program

    The NSW Government has announced a $10 million initiative to combat what the Agriculture Minister has described as a looming "fish Armageddon".








    rescue

    Surf lifesaving criticised for focus on sport over rescue

    High-profile members of the surf lifesaving movement have described a continual wrestle for resources between spending on sport and spending on rescue equipment.




    rescue

    'Can you imagine lying there for nearly a week?': 80yo woman rescued after breaking hip in home isolation

    Erika Freingruber was stuck on the floor of her Beaudesert home, south of Brisbane, for up to five days with a broken hip before police rescue her after a tip-off from the state's newly-formed coronavirus Care Army.






    rescue

    Police say neighbours helped rescue mother from fatal Singleton fire

    NSW Police say four residents helped rescue a 31-year-old woman and a child from a house fire in Singleton in which three other children died.




    rescue

    Two rescued and three have died after a catamaran capsizes near Stockton, Newcastle




    rescue

    Sailing trio describe sinking ordeal after P&O cruise ship rescue near New Caledonia

    It was a piece of rope in the middle of the ocean that ultimately led to their boat filling with water and sinking. But the three men, who all have 40 years of boating experience, say it hasn't stopped them from wanting to get back on the water.




    rescue

    NSW Fire and Rescue investigating sexual harassment, bullying claims at Dungog Fire Station

    When women at this regional fire station complained male colleagues were harassing them, management's response was to make them work from a dilapidated garage and things got worse after that.




    rescue

    Tiny koala joey rescued after mother hit by car is cared for in makeshift pouch 24 hours a day

    A koala joey, only months old, is defying the odds after being rescued when her mother was hit by a car in Port Macquarie on the NSW mid-north coast. Pixie is now in home care and being carried in a makeshift pouch 24 hours a day.




    rescue

    Tiny koala joey defying the odds after being rescued when mother hit by car

    Pixie weighed less than 200 grams when she was rescued after her mother was hit by a car. Carers thought she was too tiny to survive, but they were wrong.




    rescue

    First injured koalas treated by wildlife rescue groups after devastating bushfires

    Injured koalas receive life-saving treatment after surviving devastating bushfires on the New South Wales mid-north coast.




    rescue

    Bush pilots pull off risky remote aeroplane rescue near Derby, WA

    Two pilots have pulled off a risky retrieval operation in remote WA, dangling a 1-tonne aeroplane beneath their chopper and flying it almost 100 kilometres to the nearest town.






    rescue

    Rescuer calls for tough penalties after 'prime idiot' filmed hanging from cliff face at 'The Gap'

    A social media video of a tourist hanging off a notorious WA cliff on Easter Sunday has prompted a furious response from a sea rescue group.




    rescue

    Painstaking operation to rescue young boy stuck in Katanning chimney a success

    Emergency services rescue an eight-year-old boy after he climbed into a chimney at his home in the town of Katanning in WA's Great Southern and became stuck.




    rescue

    Volunteer rescue groups call for greater share of ratepayer-funded Emergency Services Levy

    A tax imposed on West Australian ratepayers 16 years ago to support the state's emergency services has raised more than $3 billion, but just $256 million of that has gone to bush fire brigades, and they say this is forcing them to rattle the tin for some essential equipment.




    rescue

    'Tasmania News': Bushwalkers rescued from Tasmania's wilderness, evade incident in Hobart overnight

    DAILY BRIEFING: Bushwalkers are rescued in two separate incidents in Tasmania's national parks, while road spikes are deployed after a driver evades police.




    rescue

    Tasmania News: Woman rescued from burning home, man caught with ecstasy in his underwear at airport

    DAILY BRIEFING: A Launceston woman is rescued from a house fire, and a Tasmanian judge describes the actions of a man caught with ecstasy in his underwear at Hobart Airport as "immature".